select * from tb a where subject='chinese' and not exists (select 1 from tb where subject='english' and id=a.id)

解决方案 »

  1.   

    select * from 表 a
    where subject='chinese'
        and not exists(select * from 表 where id=a.id and subject='english')
      

  2.   

    select a.* from (select id,subject from table where subject='chinese') a
    where not exits(select * from table where id=a.id and subject='english')
      

  3.   

    select * from 表 a where subject='chinese'
        and not in (select * from 表 where id=a.id and subject='english')
      

  4.   

    select * from table where subject='chinese' and id not in (select id from table where subject='english')