Select * from table1 where FD1 = 'aa' or FD1 like 'aa,%' or FD1 like '%,aa'
or FD1 like '%,aa,%'

解决方案 »

  1.   

    Select * from table1 where ','+FD1+',' like '%,aa,%'
      

  2.   

    select * from table where FD1 like '%aa%'
      

  3.   

    可以考慮使用contains函數,但是要求對字段FD1建立全文索引
    example:
    select * from table1 where Contains(FD1, 'aa' or 'bb')
      

  4.   

    不能用like?
    charindex('aa',FD1)>0
      

  5.   

    like '%aa%'与charindex('aa',FD1)>0都是不行的,会把这样的记录也查出来:
    "aaaaa,bb,cc,dd"
      

  6.   

    select * from 表
    where charindex('aa',FD1)>=1
      

  7.   

    這個沒什麼難啊?什麼上面稿得一大湖塗?select * from table where FD1 not in (select FD1 from table where FD1 like '%aa%')
      

  8.   

    没看太明白,IN的反过来 Not In