select A.field1 from A
minus
select B.field1 from B得出存在于A表中field1字段而不在B表field1字段中的记录

解决方案 »

  1.   

    MINUS All distinct rows selected by the first query but not the second。
    也就是根据第一个查询找交集吧。相类似的关键字含有union和INTERSECT。
      

  2.   

    是交集也就是存在于B表中field1字段而不在A表field1字段中的记录
      

  3.   

    差集:
    SQL> select * from aa;ID FID
    -- ---
    1  0
    2  1
    3  1SQL> select * from aa 
      2  minus
      3  select * from aa where id=3;ID FID
    -- ---
    1  0
    2  1
      

  4.   

    差集:
    SQL> select * from aa;ID FID
    -- ---
    1  0
    2  1
    3  1SQL> select * from aa 
      2  minus
      3  select * from aa where id=3;ID FID
    -- ---
    1  0
    2  1
      

  5.   

    希望得出结果的朋友能本着严谨的态度做一下测试,不能完全凭主观想象得出结论。首先贴主的语句错误,
    select bname,qty from b group by bname是执行不通的。因为qty非GROUP BY表达式。
    正确写法应该是:  1  select aname,qty from A
      2  minus
      3* select bname,sum(qty) from B group by bname
    SQL> /未选定行结果是不会查询出任何数据。
      

  6.   

    sum(qty) 是我少写上去的,本意是如此,请请大家的指教,我知道怎么回事了,结贴.