有职工表和退休表。我现在想得到在职人员的表,该怎么做!(就是用职工表-退休表)

解决方案 »

  1.   

    select 在职人员 from 职工表 where not in(select * from 退休表)
      

  2.   

    select 职工表.id from 职工表 where not in(select 退休表.id from 退休表)
      

  3.   

    select * from 职工表 where id not in(select 退休表.id from 退休表)
      

  4.   

    select * from 职工表 where id not in(select 退休表.id from 退休表)
      

  5.   

    select * from 职工表 where 职工表.id not in(select 退休表.id from 退休表)
      

  6.   

    什么数据库?
    oracle可以试试
    select * from 职工表 where…… 
    MINUS
    select * from 退休表 where……
      

  7.   

    select * from 职工表 where id not in(select 退休表.id from 退休表)