我希望在 col1的字段查找以下数据,当然还有很多其他数据'2006206110'
'2006216700'
'2006236570'
'2006237470'
'2006007030'
'2006069140'希望查找出来是col1里面没有的。比如没有'2006069140'那就显示'2006069140'
   

解决方案 »

  1.   

    ?select * from tb where col1 not in(select col1 from ta) ?
      

  2.   

    select * 
      from a 
     where col1 not in (select col1 from b)
      

  3.   


    select * from sb union select * from tb where col1 not in(select col1 from ta) ?
      

  4.   

    select * from tb where col1 not in(select col1 from ta)这样的话 
    也会把我表中的其他记录都返回来我只需要返回 
    '2006206110' 
    '2006216700' 
    '2006236570' 
    '2006237470' 
    '2006007030' 
    '2006069140' 
    没有找到的记录
      

  5.   

    select * from tb where col1 not in('2006206110'  
    '2006216700',  
    '2006236570' , 
    '2006237470' , 
    '2006007030' , 
    '2006069140' )
      

  6.   

    规则不明确。col1里面有的是有限的,col1里面没有的是无限的,你在无限里查不定个范围吗?