字段like多个条件(or关系)简写

字段 like ‘匹配串1’or 字段 like ‘匹配串2’or ... 有如下简写方式

oracle:

select  * from tablex where REGEXP_LIKE(字段名, '(匹配串1|匹配串2|...)') ;//全模糊匹配

select  * from tablex where REGEXP_LIKE(字段名, '^(匹配串1|匹配串2|...)') ";//右模糊匹配

select  * from tablex where REGEXP_LIKE(字段名, '(匹配串1|匹配串2|...)$') ";//左模糊匹配

 

SqlServer

select  * from tablex where f1 like '%[匹配串1|匹配串2|匹配串3]%'

 

posted @ 2019-04-08 14:31  就这么着吧  阅读(29819)  评论(0)    收藏  举报