SQL SERVER 中
字段在某个字符串中怎么写
select * from table1 a where a.fld1 instr('abddeedd')

解决方案 »

  1.   

    select * from table1 a where a.fld1 like '%abddeedd%'
      

  2.   

    select * from table1 a where a.fld1 in ('abddeedd')
      

  3.   

    先取出表的字段;
    TDatabase.getFieldnames(tablename);
    Tadoconnection.getFieldnames(tablename);然后逐个比较试试。
      

  4.   

    select * from table1 a where a.fld1 like '%abddeedd%'
    应该可以吧。
      

  5.   

    select * from table1 a where a.fld1 in ('abddeedd')
      

  6.   

    a.fld1 in ('abddeedd')
    语法没问题
    可出的结果是空白
      

  7.   

    这样试试
    select * from table1 a where charindex(a.fld1, 'abddeedd')
      

  8.   

    select * from table1 a where a.fld1 like '%abddeedd%'
      

  9.   

    select * from table1 a where a.fld1 instr('%abddeedd')