select a.p1,a.p2,a.p3 from ww1 a
minus
select b.l1,b.l2,b.l3 from ww2 b

解决方案 »

  1.   

    select t.P1,t.P2 from tablename t,(select P1,P2 from tablename) a
    where t.P1=a.P1 and t.P1!=a.P2
      

  2.   

    {select a.p1,a.p2,a.p3 from ww1 a
    minus
    select b.l1,b.l2,b.l3 from ww2 b}
    上面这个方法是可以的但是 如果我的ww2不是三列只有L1,L2两列 只要不同时满足这两个条件就显示, 那我想根据判断算出来之后怎么显示第一个ww1表呢
      

  3.   

    查找ww1中p1和p2数据列不存在于ww2数据的写法:
    select a.* 
    from ww1 a
    where not exits (select 1 from  ww2 b where a.p1=b.L1 and a.p2=b.L2)