开发者

sql query: if any of the columns have even one word mentioned in a given array of words, select that entire row

开发者 https://www.devze.com 2023-02-03 07:11 出处:网络
I have the following sql query: select distinct * from tableName where contains ( (column1, column2, column3), \'default\' )

I have the following sql query:

select distinct * from tableName where contains ( (column1, column2, column3), 'default' )

This works fine. Instead of looking at just one keyword 'default' is it possible开发者_运维知识库 to mention an array of words and if any of the columns have even one word mentioned in that array of words, select that entire row.


select distinct * 
from tableName 
 where contains ( (column1, column2, column3), 'default' OR 'defalut2')

http://msdn.microsoft.com/en-us/library/aa258227%28v=sql.80%29.aspx

0

精彩评论

暂无评论...
验证码 换一张
取 消