select * from tabA where colA like '%A%'select * from tabA where ','+colA+',' like '%,A,%'

解决方案 »

  1.   

    没问题
    select * from tabA where CHARINDEX(',A,',','+colA+',')>0
      

  2.   

    我這樣試了一下:
    DECLARE @varNotation varchar(60)
    set @varNotation='D' + ',' +'B'
    select @varNotation
    select '1' where '%D%' like ( @varNotation) 發現還沒有達到預期效果
      

  3.   

    DECLARE @varNotation varchar(60)
    set @varNotation='D' + ',' +'B'
    select @varNotation
    select '1' where  @varNotation like  '%D%'
      

  4.   

    select 'a' where 'd' in (left(@a,1),right(@a,1))
      

  5.   

    DECLARE @varNotation varchar(60)
    set @varNotation='D' + ',' +'B'
    select @varNotation
    select '1' where  @varNotation like  '%D%'
      

  6.   

    如果要消除 D 与 DD 的Bug必须用DECLARE @varNotation varchar(60)
    set @varNotation='DD' + ',' +'B'
    select @varNotation
    select '1' where  ','+@varNotation+',' like  '%,D,%'
      

  7.   

    如果要消除 D 与 DD 的Bug必须用DECLARE @varNotation varchar(60)
    set @varNotation='DD' + ',' +'B'
    select @varNotation
    select '1' where  ','+@varNotation+',' like  '%,D,%'
      

  8.   

    1。
    select * from tabA where CHARINDEX('A',colA)>0
    2。
    select * from tabA where colA like '%A%'
      

  9.   

    1。
    select * from tabA where CHARINDEX('A',colA)>0
    2。
    select * from tabA where colA like '%A%'