高级数据过滤(like)

Posted 不忘初心de博客

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了高级数据过滤(like)相关的知识,希望对你有一定的参考价值。

单字符过滤 ‘_‘

select * from T_Employee where FName like  ‘_erry‘

多字符过滤 ‘%‘

select * from T_Employee where FName like  ‘T%‘

 

集合匹配过滤 [jt] :第一个字母为J 或t的信息

                  [^jt] 反集合: 第一个字母不为J 或T 的信息

select * from T_Employee where FName like‘[jt]%‘

select * from T_Employee where FName  like ‘[^jt]%‘

 

SQL中查询空值, 不能直接使用普通的等于来判断, 要使用关键字‘is null / is not null ‘,因为数据库中一些特殊的设定会查询不到

select * from T_Employee where FAge is null
select * from T_Employee where FAge is not null and FSalary>2000

反运算符 ‘ != 不等于 !< 不小于  ‘ 等  三种表达方式 ‘!‘符只能在SqlServer DB2 数据库中 使用

select * from  T_Employee where FAge!=23 and FSalary!<5000
select * from T_Employee where FAge<>23 and FSalary>=5000
select * from T_Employee where not(FAge=23) and not(FSalary<5000)  not 反运算

 

以上是关于高级数据过滤(like)的主要内容,如果未能解决你的问题,请参考以下文章

高级数据过滤(like)

第5课 高级数据过滤

Laravel:高级搜索表单查询

数据过滤--高级搜索条件查询数据

数据表高级过滤器菜单,如 Excel 或 Kendo UI Grid?

4.高级数据过滤 ---SQL