select * from table where field1 in ('1','2','3','12','4')

解决方案 »

  1.   

    select * from table where  x  like  '%,2,%'
      

  2.   

    select * from T1 where ( col like '2*' or col  like '*,2,*')
    and col not like '*,?2,*'
    and col not like '*,2?,*'
    and col not like '?2*'
    and col not like '2?*'
    and col not like '*,?2*'
    and col not like '*,2?'
      

  3.   

    "包含有2的记录,而不包括12及其他"
    1.是不是包含2,不包含12及其它有2的,e.g:23、42
    "x字段值类似为'1,2,3,12,4'  "
    2.里面的数字长度固定吗,是不是都为不超过两位数的数
      

  4.   

    上面的不行吧.select * from table where ','+replace(x,' ','')+',' like '%,2,%'
      

  5.   

    select * from table where x like '%2%'and x <> '12'
      

  6.   

    select * from table where  x  like  '%2%'and charindex('12',x)=0
      

  7.   

    不好意思,有些人误会我的意思了,我这里的数可变的,查询时之所以加了两个逗号,是为了区别2,12还有1,13类似的数,即某一位相同而整个不同的数,请再帮我想想,谢谢,而且是access,是不是不支持%,而应该是*吧?