select f1 from yourtable where charindex(f1, 'ABC123456')>0

解决方案 »

  1.   

    select * froma where s1 like '%'+f1+'%'
      

  2.   

    多谢两位
    to lovesql(ligg),
    select f1 from yourtable where charindex('ABC123456',f1)>0 是返回F1中所有包含'ABC123456'的记录
    TO (ZJCXC)
    select * froma where s1 like '%'+f1+'%' 也是返回F1中所有包含'ABC123456'的记录
    我的意思是要返反过来,只要该字段被包含在该字符串中就返回该记录
    如:
      A(F1)
        ABC
        123
        456
        123456
        12
        
       只要F1中字符串存在于'ABC123456'中都返回     
     
      

  3.   

    selecT * from where si like [abc123456]