假设一个sql语句:
select A from t
where B in (select X from q)
or C in (select X from q)
我想将where的两个条件(or关系)整合起来,请问该怎么改写好呢
假设一个sql语句:
select A from t
where B in (select X from q)
or C in (select X from q)
我想将where的两个条件(or关系)整合起来,请问该怎么改写好呢
多字段in
select A from t
where (B,C) in (select X,X from q)
如果B,C是or的关系则写两个SQL进行union