字段有
a,b,c
现在要求(b=x AND c=True)AND(a=x AND c=False),请问这样的select语句该怎么写?
数据库用Access我尝试过使用intersect,但好像不支持

解决方案 »

  1.   

    我使用
    select * from BIAO where a="+x+" and c=True and b=(select a from BIAO where b="+x+" and c=False)
    提示:子查询最多能返回一个记录
      

  2.   

    select * from BIAO where a="+x+" and c=True union
    select * from BIAO where b="+x+" and c=False
      

  3.   

    union是并操作,你这样查询出来的结果是(b=x AND c=True)OR(a=x AND c=False),而不是我要的(b=x AND c=True)AND(a=x AND c=False),
      

  4.   

    (b=x AND c=True)AND(a=x AND c=False) 这种语句本身就有问题吧?
    既然要c=true ,干吗还要同时为false呢,逻辑上就通不过