运算符

1.算数运算符

乘  

除  

#select 9/4 #2.25
#select 9 div 4 #2

余数

#select 9 %4 #1
#select 9 mod 4 #1

2.比较运算符

大于:>

小于  <

大于等于 >=

小于等于<=

等于 =  [赋值和比较都用=]

不等于     !=       <>

安全等于 <=>  [专门用于NULL]

 

#select name,salary from employee where salary=null   错误
#select name,salary from employee where salary<=>null  正确
#select name,salary from employee where salary is null   正确

3.逻辑运算符

与 &&   and

或 ||   or   

非 ! not

4.区间范围和集合范围

between and    >=   and  <=

#select name,salary from employee where salary BETWEEN 10000 and 15000

not  between and <  or >

in

#select name,salary from employee where salary in (5000,8000)

not in 

5.模糊查询

_  表示确定一个字符

%  表示任意个数字符

#select * from employee where name like '_兵%'
#select * from employee where name like '%兵'

 

posted on 2020-06-19 13:57  happygril3  阅读(113)  评论(0)    收藏  举报

导航