3 回答
TA贡献1829条经验 获得超13个赞
ANSI SQL92:
%
_
仅当指定时才使用ESCAPE字符。
令人失望的是,许多数据库不遵循标准规则并添加额外的字符,或者在缺少ESCAPE时默认使用默认值'\'来错误地启用它。好像我们对'\'还没有足够的麻烦!
在这里编写与DBMS无关的代码是不可能的,因为您不知道必须转义哪些字符,并且标准说您无法转义不需要转义的内容。(请参阅第8.5节/一般规则/3.a.ii。)
TA贡献1824条经验 获得超8个赞
Sybase:
% : Matches any string of zero or more characters.
_ : Matches a single character.
[specifier] : Brackets enclose ranges or sets, such as [a-f]
or [abcdef].Specifier can take two forms:
rangespec1-rangespec2:
rangespec1 indicates the start of a range of characters.
- is a special character, indicating a range.
rangespec2 indicates the end of a range of characters.
set:
can be composed of any discrete set of values, in any
order, such as [a2bR].The range [a-f], and the
sets [abcdef] and [fcbdae] return the same
set of values.
Specifiers are case-sensitive.
[^specifier] : A caret (^) preceding a specifier indicates
non-inclusion. [^a-f] means "not in the range
a-f"; [^a2bR] means "not a, 2, b, or R."
添加回答
举报