通配符 空值

通配符主要用于字符串的查询和匹配

_    :匹配一个字符   

  select * from mytable where name like '张_'

  查询条件张姓,姓名2个字

%   :匹配多个字符

  select * from mytable where name like '张%'

  查询条件 张姓

[]    :范围或转义

  select * from mytable where name like '张[0-9]'    --查询条件 张0---张9

  select * from mytable where name like '张[a-z]'    --查询条件 张a---张z

  select * from mytable where name like '张[%]'    --查询条件 张%

 ^   :非

  select * from mytable where name like '张[^a]'    --查询条件  张姓  ,名字非a

  select * from mytable where name not  like '张[a]    --和上面的结果不同

is null   空值 ; is not null  非空

   select * from mytable where name is null     --查询条件name为空

任何与null 运行的结果,都是 null

  select 2000 + null  --结果为null

原文地址:https://www.cnblogs.com/boentouch/p/13020048.html