select AA.a from AA
mins
select BB.a from BB
a 是 AA和BB中都有的字段

解决方案 »

  1.   

    select AA.a from AA mins select BB.a from BB
    这个sql好像不能执行
      

  2.   

    敲错了,不要意思,是
    select AA.a from AA 
    minus 
    select BB.a from BB
      

  3.   

    select AA.* from AA ,BB
        where AA.a = BB.a (+)
            and BB.a is null
    ;
      

  4.   

    so cool
    再问一下:这些不常见的sql在什么地方有介绍?
      

  5.   

    这些不常见的sql,其实在oracle文档中都有介绍的.
      

  6.   

    或者
    select * from AA x where not exists (select '1' from BB y where AA.a=BB.a)
    也可以。
    不过,才几十万的数据量就喊大表,确实是太夸张了。