基础14_转义字符和特殊字符ASCII
一、摘要
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
ERP技术讨论群: 288307890
技术交流,技术讨论,欢迎加入
Technology Blog Created By Oracle ERP - 鲍新建
技术交流,技术讨论,欢迎加入
Technology Blog Created By Oracle ERP - 鲍新建