select * from t_jy_weiwaipx where pxbh not in (select pxbh from t_jy_pxban)

解决方案 »

  1.   

    用外连接select * from T_jy_weiwaipx as a left outer join T_jy_pxban as b on a.pxbbh=b.pxbbh where b.pxbbh is null
      

  2.   

    select * from T_jy_weiwaipx where pxbbh not in (select pxbh from T_jy_pxban)
      

  3.   

    删除:delete T_jy_weiwaipx where pxbbh not in (select pxbh from T_jy_pxban)
      

  4.   

    查询:
    select * from from T_jy_weiwaipx a
    where not exists (
    select 1 from T_jy_pxban b
    where a.pxbbh=b.pxbh
    )删除:
    delete a
    from T_jy_weiwaipx a
    where not exists (
    select 1 from T_jy_pxban b
    where a.pxbbh=b.pxbh
    )