基础14_转义字符和特殊字符ASCII一、摘要


PSQL转义字符

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

PLSQL对应的字符和序号关系

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

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

PLSQL对应的字符和序号关系

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

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;
--38
select * from bxj_test where testchar like '%'||chr(38)||'%';
--A&B  


Thanks and Regards

2015-05-06 Created By BaoXinjian

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





相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-16
  • 2021-09-24
  • 2021-09-24
猜你喜欢
  • 2021-11-12
  • 2022-01-21
  • 2021-07-12
  • 2020-04-08
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案