有mdn,cir,pid,status的mysql表 我想找到所有不在x和Y cir中的mdn,使用PID作为Z ..不要使用子查询或多个查询。
this is what i have tried but it is giving me wrong answer :
select * from tbl where (cir not in ('X','Y') && PID not in ('Z')) ;
答案 0 :(得分:0)
如果我理解你,你想要所有人,不包括cir in('x','y')
+ pid = 'z'
在一起的行,而不是每个人分别如此:
select * from tbl
where NOT(cir in ('X','Y') AND PID ='Z') ;