筛选同时符合多个字段指定条件记录的SQL

 

SELECT * FROM `TABLE` WHERE (column1+':'+column2) in (column1Value1+':'+column2Value1,column1Value2+':'+column2Value2);

 

SELECT * FROM `view_action_logs` WHERE (column1,column2) in (('column1Value1','column2Value1'),('column1Value2','column2Value2'));

 

PS : 注意区分查找字段的类型

 

 

End.

 

posted @ 2014-01-24 09:26  lianche  阅读(4086)  评论(0编辑  收藏  举报