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.
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.
FROM T1
WHERE instr(f2,f1);
其中f1是字段1,f2是另一个特定的字符串
select t1.f1 from t1 where instr(f21,f1) or instr(f22,f1) ... or instr(f2n,f1)
其中f21到f2n是特定字符串中字符的所有排列组合,既使字符串未知,也以编程求出。如F1可能为aa,aaa,aaaa等,尚未想出方法。
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有无重复字符都一样。