Home  >  Article  >  Database  >  oracle的escape转义字符

oracle的escape转义字符

WBOY
WBOYOriginal
2016-06-07 15:50:361140browse

定义:escape关键字经常用于使某些特殊字符,如通配符:'%','_'转义为它们原 来的字符的意义,被定义的转义字符通常使用'/',但是也可以使用其他的符号。 实例: SQL select * from t11 where name like '%_%'; NAME ---------- aa_a aaa SQL select * from t

定义:escape关键字经常用于使某些特殊字符,如通配符:'%','_'转义为它们原

来的字符的意义,被定义的转义字符通常使用'/',但是也可以使用其他的符号。

实例:

SQL> select * from t11 where name like '%_%';

NAME
----------
aa_a
aaa
SQL> select * from t11 where name like '%/_%' escape '/';

NAME
----------
aa_a

注意:如果是 '/' 作为检索字符, 必须 用 '/' 作为转义符, 正斜扛也一样.
select * from wan_test where psid like '%//%' escape '/'

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn