1、select a.* from a,b where a.INST_ID = b.INST_ID and b.col = '条件';2、select b.INST_ID from b,
(select INST_ID,PRDT_ID,LINE_NO from b) m
where b.INST_ID <> m.INST_ID
and (b.PRDT_ID = m.PRDT_ID and b.LINE_NO = m.LINE_NO)
order by b.INST_ID
(select INST_ID,PRDT_ID,LINE_NO from b) m
where b.INST_ID <> m.INST_ID
and (b.PRDT_ID = m.PRDT_ID and b.LINE_NO = m.LINE_NO)
order by b.INST_ID
select n.INST_ID
from
(select a.* from a,b where a.INST_ID = b.INST_ID and b.col = '条件') n,
(select a.* from a,b where a.INST_ID = b.INST_ID and b.col = '条件') m
where
b.INST_ID <> m.INST_ID and (b.PRDT_ID = m.PRDT_ID and b.LINE_NO = m.LINE_NO)
order by b.INST_ID
可能看起来有点重复,但是我没有更好的方法了!