比如我
集合1.select A_no from taba,tabc,tabd where *****************集合2.select A_no from taba,tabb where *****************集合1里可能查出重复的A_no,比如
A_no
a
a
b
b
c
d集合2里主要是查出有效的A_no,里面A_no不重复,比如
a
c我现在想求出的结果
A_no
a
a
c
怎么办呢。谢谢
集合1.select A_no from taba,tabc,tabd where *****************集合2.select A_no from taba,tabb where *****************集合1里可能查出重复的A_no,比如
A_no
a
a
b
b
c
d集合2里主要是查出有效的A_no,里面A_no不重复,比如
a
c我现在想求出的结果
A_no
a
a
c
怎么办呢。谢谢
where A_no in
(select A_no from taba,tabb where *****************)
集合1.select A_no from taba,tabc,tabd where *****************
UNION ALL
集合2.select A_no from taba,tabb where *****************
给多一个不相同的字段B2,
集合1.select A_no,B2 from taba,tabc,tabd where *****************
INTERSECT
集合2.select A_no,B2 from taba,tabb where *****************
(select A_no from taba,tabb where *****************)
and 其它条件
from (select A_no from taba,tabc,tabd where *****************) t1
where exists
(select 1 from (select A_no from taba,tabb where *****************) t2
where t2.a_no = t1.a_no)