Oracle的模糊匹配时使用的通配符:
_ (下划线)表示任何单个字符
% (百分号)表示任何零或多个字符
任何非下划线和百分号的字符都表示本身。逃逸字符: 常用? 也可以使用~
SQL> select * from test;A
----------
thisis%
this?istt
abcdetSQL> select * from test where a like '%?%' escape '?';A
----------
thisis%SQL> select * from test where a like '%~%' escape '~';A
----------
thisis%SQL> select * from test where a like '%??%' escape '?';A
----------
this?istt
_ (下划线)表示任何单个字符
% (百分号)表示任何零或多个字符
任何非下划线和百分号的字符都表示本身。逃逸字符: 常用? 也可以使用~
SQL> select * from test;A
----------
thisis%
this?istt
abcdetSQL> select * from test where a like '%?%' escape '?';A
----------
thisis%SQL> select * from test where a like '%~%' escape '~';A
----------
thisis%SQL> select * from test where a like '%??%' escape '?';A
----------
this?istt
ex:select * from test where a like 'a#_m_ds' escape '#'
表示查找以a_m开头,以ds结尾的字符
#_表示#后紧接着的_是实际存在的字符
第二个_(_ds)没有逃逸字符(#)在前面作标识,表示通配符其他的boydgmx(授人以鱼不如授人以渔(baidu&google)) 已经说的很清楚了