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

解决方案 »

  1.   

    有点思路了,不过我需要1点,2点和在一起写一个查询语句你看我写的对不:
    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
    可能看起来有点重复,但是我没有更好的方法了!