Mr. Li, a prodigy 2022-06-24 07:53:38 阅读数:599
One must keep writing , In order not to be submerged by the vast sea of people
Articles are constantly updated , You can search by wechat 【 Xiaoqi JAVA interview 】 First time reading , reply 【 Information 】 Access to benefits , reply 【 project 】 Get the source code of the project , reply 【 The resume template 】 Get resume template , reply 【 Learning Roadmap 】 Get a learning roadmap .
Relationship between operation :>、=、<、>=、<=、!=、<>
Range operation :between…and
Empty judgment :is null、is not null
IN Judge :in、not in
Fuzzy query :like、not like
Logical operations :and( And )、or( or )、not( Not )
select * from student where age < 20;
select * from student where sex=' male ';
Either of the following is OK
select * from student where sex != ' male ';
select * from student where sex <> ' male ';
and、or
select * from student where sex != ' male ' and age < 20;
select * from student where sex = ' Woman ' or age > 20;
Either of the following is OK
select * from student where age < 20;
select * from student where age not >= 20;
Either of the following is OK , however between Is an operator , The other is a relational operator >= Add a logical operator and, therefore between It's more efficient .
select * from student where age between 10 and 20;
select * from student where age >= 10 and age <= 20;
select * from student where birthday between '01-9 month -98' and '30-9 month -1998';
select * from student where name is not null;
select * from student where name in (' Zhang San ',' Li Si ');
select * from student where name in (' Zhang San ',null);
select * from student where name not in (' Zhang San ',null);
Here we need to pay attention to , When not in There is null when , No results can be found from the query .
“_”: Match any one of the symbols .
“%”: Match any symbol , It can be 0、1、2、 Multiple symbols .
select * from student where name like ' Li %';
select * from student where name like ' Li _';
select * from student where name like '% handsome %';
order by [ Sort rule ]
Default and asc Positive sort
desc It's in reverse order
select * from student order by age;
select * from student order by age desc;
select * from student order by age desc,sno;
select * from student order by age desc,sno desc;
The relevant contents here have not been sorted out yet , The article continues to be updated later , Recommended collection .
The commands involved in the article must be typed several times each like me , Only in the process of knocking can you find out whether you really master the command .
You can search by wechat 【 Xiaoqi JAVA interview 】 First time reading , reply 【 Information 】 Access to benefits , reply 【 project 】 Get the source code of the project , reply 【 The resume template 】 Get resume template , reply 【 Learning Roadmap 】 Get a learning roadmap .
copyright:author[Mr. Li, a prodigy],Please bring the original link to reprint, thank you. https://en.javamana.com/2022/175/202206240311493023.html