oracle sql中使用contains函数解决like in %组合使用 的问题

来源:互联网 发布:芥末留学网 知乎 编辑:程序博客网 时间:2024/06/05 19:47


I want something as easy as WHERE something LIKE ('bla%', '%foo%', 'batz%') instead of

WHERE something LIKE 'bla%'OR something LIKE '%foo%'OR something LIKE 'batz%'

I'm working with SQl Server and Oracle here but I'm interested if this is possible in any RDBMS at all.

Oracle:

WHERE CONTAINS(t.something, 'bla OR foo OR batz', 1) > 0

SQL Server:

WHERE CONTAINS(t.something, '"bla*" OR "foo*" OR "batz*"')


http://stackoverflow.com/questions/3014940/is-there-a-combination-of-like-and-in-in-sql

0 0
原创粉丝点击