LIKE Escape Sequence
ODBC uses escape sequences for the LIKE clause. The syntax of this escape sequence is as follows: {escape 'escape-character'}In BNF notation, the syntax is as follows:ODBC-like-escape ::=
  ODBC-esc-initiator escape 'escape-character' ODBC-esc-terminatorescape-character ::= characterODBC-esc-initiator ::= {ODBC-esc-terminator ::= }To determine if the driver supports the LIKE escape sequence, an application can call SQLGetInfo with the SQL_LIKE_ESCAPE_CLAUSE information type.

解决方案 »

  1.   

    SELECT T1.F1, T1.F2
    FROM T1
    WHERE instr(f2,f1);
    其中f1是字段1,f2是另一个特定的字符串
      

  2.   

    Tophead的语句可能不对,如果此特定的字符串为已知,且长度也不是太长,则可以用一个查询:Select T1.F1 From T1 Where Instr(F1,"a") and instr(F1,"b");如果为未知的,则可以用一个循环生成后面的条件语句。
      

  3.   

    TopHead和tanhl的方法都不对,TopHead的方法只能找出次序相同的F1,tanhl的方法找出的则是F1包含了所有特定字符串中的字符。如F1不包含重复字符,如aa、bb,则可使用如下查询:
    select t1.f1 from t1 where instr(f21,f1) or instr(f22,f1) ... or instr(f2n,f1)
    其中f21到f2n是特定字符串中字符的所有排列组合,既使字符串未知,也以编程求出。如F1可能为aa,aaa,aaaa等,尚未想出方法。
      

  4.   

    有了更好的方法,如下:
    select f1 from t1 where instr(f2,mid(f1,1,1)) and instr(f2,mid(f1,2,1)) and ... and instr(f2,mid(f1,n,1))
    n为字段f1的长度,不管f1有无重复字符都一样。