您的位置:首页 > 其它

基础14_转义字符和特殊字符ASCII

2016-03-27 17:37 375 查看

一、摘要

PSQL转义字符


二、PLSQL转义字符
PLSQL对应的字符和序号关系




二、PLSQL特殊字符
PLSQL对应的字符和序号关系



1. 转义字符为' ';

select * from bxj_test where testchar like 'sdd _%' escaape ' ';--sdd_kk

2. 转义字符为'\';

select * from bxj_test where testchar like 'sdd\_%' escape '\';  --sdd_kk
3. 转义字符为'=';

select * from bxj_test where testchar like 'sdd=_%' escape '=';--sdd_kk

4. 转义字符为'/';

select * from bxj_test where testchar like 'sdd/_%' escape '/';--sdd_kk

5. 查找包含所有'_'的字段。

select * from bxj_test where testcharlike '%\_%' escape '\';--sdd_kk

6. 查找含有'%'的所有字段:

select * from bxj_test where testchar like '%\%%' escape '\';--dffa%asfs--1%2345--1%54321--2%54321--%%54321

7. 是'&'不能通过转义字符查找,通过ASCII进行装换

select * from bxj_test where testchar like '%\&%' escape'\';

--ORA-01424: 转义符之后字符缺失或非法

select ascii('&') from dual;--38select * from bxj_test where testchar like '%'||chr(38)||'%';--A&B


Thanks and Regards

2015-05-06 Created By BaoXinjian



来自为知笔记(Wiz)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: