select * from table a,table bwhere (cint(1=1)+cint(2=2)+cint(3=3)+cint(4=4)+cint(5=5))<=-3 and (cint(1=1)+cint(2=2)+cint(3=3)+cint(4=4)+cint(5=5))>-5; 忘记说了,我是按照ACCESS里写语句的反正就是cint就是将boolean转换为数字true为-1,false为0,mysql应该有类似的函数的
很简单,试下我这个sql查出来c3、c4、c5重复的列 in一下就好select * from biao b1 where exists ( select 1 from (select c3,c4,c5 ,count(*) from biao b2 group by c3,c4,c5 having count(*)>1 ) t where 3=3 and 4=4 and 5=5)