查询表1中不包含表2的代码如下
select *from 1 where  Num1 not in(select Num2 from 2)
要查询表1中不包含表2且不包含表3、表4的代码怎么表示

解决方案 »

  1.   

    select   * from   tb1   
    where     Num1   not   in(select   Num2   from   tb2) 
    and Num1   not   in(select   Num3   from   tb3)
    and Num1   not   in(select   Num4   from   tb4)
      

  2.   

    select * from tb1 
    where num1 not in(select num from tb2)
    and num1 not in(select num from tb3)
    and num1 not in(select num from tb4)
      

  3.   

    查询表1中不包含表2的代码如下 
    select   *from   1   where     Num1   not   in(select   Num2   from   2) 
    要查询表1中不包含表2且不包含表3、表4的代码怎么表示select * from tb1 where id not in 
    (select id from tb2 union all select id from tb3 union all select id from tb4)
      

  4.   

    select   *   from   tb1  
    where   num1   not   in(select   num   from   tb2 union select   num   from   tb3 union select   num   from   tb4) 
      

  5.   

    select * from tb1 where id not in 
    (select id from tb2 union all select id from tb3 union all select id from tb4)