基础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;
--38
select * 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 - 鲍新建
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值