select * from a where partindex("%abc%",b)>0

解决方案 »

  1.   

    不知道楼主是这个意思吗
    select * from a where b like '%abc%'
      

  2.   

    ??
    select colname from tablename where colname  like '%%'
      

  3.   

    就等于上面的 select * from a where b like '%1abcdefg%' 的话肯定返回 eof 的啊,因为abc里不包含1abcdefg
    现在我想它掉转,用1abcdefg来查找字段b里的abc内容啊!这样就不会返回eof了,为什么sql语言不可以这样呢?唉........ select * from a where '1abcdefg' like %b%
      

  4.   

    declare @a table(b varchar(3))
    insert @a
    select 'abc'
    union all select 'rtr'
    union all select 'ert'select * from @a
    where '1abcdefg' like '%'+b+'%'
      

  5.   

    --测试数据
    declare @a table(b varchar(3))
    insert @a
    select 'abc'
    union all select 'rtr'
    union all select 'ert'
    --查找
    select * from @a
    where '1abcdefg' like '%'+b+'%'
      

  6.   

    select * from a where  charindex(b,'labcdefg')>0
      

  7.   

    select * from a where '1abcdefg' like '%' + b + '%'