一、 select * from A where t2 ="yyx" and t3="ccc" and t0="ccc" or t1 ="xxx" and t0="ccc"; 二、 select * from (select * from A where t0="ccc") where t2 ="yyx" and t3="ccc" or t1 ="xxx";
综合分析了楼主的意图,应该是这样来实现的 or用union来表示,and 用where里的条件来表示 select * from A where t2 = "yyx" and t3= "ccc" union select * from A where t1 = "XXX"
你这里本身说的就矛盾啊
t1 t2 t3都是or的关系 怎么后面t2和t3又是and的关系呢
你这里本身说的就矛盾啊
t1 t2 t3都是or的关系 怎么后面t2和t3又是and的关系呢
select * from A where t2 ="yyx" and t3="ccc" and t0="ccc" or t1 ="xxx" and t0="ccc";
二、
select * from (select * from A where t0="ccc") where t2 ="yyx" and t3="ccc" or t1 ="xxx";
or用union来表示,and 用where里的条件来表示
select * from A where t2 = "yyx" and t3= "ccc"
union
select * from A where t1 = "XXX"