数据表table中有字段a,b,c,d。其中字段a,b值为0或1;c,d值为0或1。现在使用select语句,筛选出ab字段为1,cd字段有一个为1。select * from table where a=1 and b=1 and(c=1 or d=1);这么写选不出来,求正确写法,谢谢
感觉没问题啊。
这个试试?
select * from table where a=1 and b=1 and (c=1 || d=1);
你能确定abcd的值?不要用或
确定不了就用占位符啊