表里的一个字段有这些数据 'abc' 'bc' 'abcd' 'bcd'...
我怎么通过'abcde'这个字符串把他们找出来?sqlserver下有没有现成的函数可用?

解决方案 »

  1.   


    select * from tablename where 'abcde' like '%'+ columnname +'%'
      

  2.   

    --用SQL Server 2005 吗? SQL server 2005 就有很多解决办法了.
      

  3.   

    zlp321002(龙卷风2006)
    你能把方法贴出来吗?
      

  4.   

    create table t(col varchar(100))
    insert t select 'abc'
    union all select 'bc' 
    union all select 'abcd'
    union all select 'bcd'select * from t
    where charindex(col,'abcde')>0drop table t
    /*
    col                                                                                                  
    ---------------------------------------------
    abc
    bc
    abcd
    bcd
    */
      

  5.   

    我下周一试下coolingpipe(冷箫轻笛) 的方法,呵呵
      

  6.   

    coolingpipe(冷箫轻笛) 应该明白我的意思了,搞定.