Home > Database > Mysql Tutorial > 特殊字符

特殊字符

WBOY
Release: 2016-06-07 16:04:56
Original
1074 people have browsed it

select qa字符串a from dual q 单引号转义符,a可以任意字符,完整输出字符串. 定义:escape关键字经常用于使某些特殊字符,如通配符:%,_转义为它们原 来的字符的意义,被定义的转义字符通常使用\,但是也可以使用其他的符号。 实例: SQL select * from t11

select q'a字符串a' from dual
q' 单引号转义符,a可以任意字符,完整输出字符串.


定义: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 '/';

select * from
(select 'a%' s from dual
union all
select 'ab' s from dual)
where s like 'a\%' escape '\'

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template