用sql语句把table_A少的数据从table里找出来

解决方案 »

  1.   

    select *From table
    where table_A少
      

  2.   


    select * from table where not exists(select 0 from table_A where 判断条件)
      

  3.   

    用sql语句把table_A少的数据从table里找出来
      

  4.   

    select * from table as t  where not exist(select 1 from table_A where 条件=t.条件)条件指的是两个表的关联字段
      

  5.   

    无法绑定由多个部分组成的标识符‘lib.did’
      

  6.   

     CREATE TABLE #table ( NAME NVARCHAR(50) )
      
      CREATE TABLE #table_a ( NAME NVARCHAR(50) )
      
      INSERT    INTO #table
      VALUES    ( '张三' ),
                ( '李四' ),
                ( '王五' ),
                ( '赵六' )
      INSERT    INTO #table_a
      VALUES    ( '张三' ),
                ( '王五' )
    --#table
      SELECT    name  FROM      #table
    --#table_A 
      SELECT    name  FROM      #table_A
      
    --存在于#table,不存在于#table_A里面的数据 
      SELECT    name  FROM      #table
      EXCEPT
      SELECT    name  FROM      #table_A
      
      DROP TABLE #table
      DROP TABLE #table_A