3 回答

TA貢獻(xiàn)1829條經(jīng)驗 獲得超13個贊
ANSI SQL92:
%
_
僅當(dāng)指定時才使用ESCAPE字符。
令人失望的是,許多數(shù)據(jù)庫不遵循標(biāo)準(zhǔn)規(guī)則并添加額外的字符,或者在缺少ESCAPE時默認(rèn)使用默認(rèn)值'\'來錯誤地啟用它。好像我們對'\'還沒有足夠的麻煩!
在這里編寫與DBMS無關(guān)的代碼是不可能的,因為您不知道必須轉(zhuǎn)義哪些字符,并且標(biāo)準(zhǔn)說您無法轉(zhuǎn)義不需要轉(zhuǎn)義的內(nèi)容。(請參閱第8.5節(jié)/一般規(guī)則/3.a.ii。)

TA貢獻(xiàn)1824條經(jīng)驗 獲得超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."
添加回答
舉報