随笔 - 571  文章 - 4  评论 - 253  阅读 - 72万

基础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



来自为知笔记(Wiz)


posted on   东方瀚海  阅读(1372)  评论(0编辑  收藏  举报
编辑推荐:
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 单线程的Redis速度为什么快?
· SQL Server 2025 AI相关能力初探
· 展开说说关于C#中ORM框架的用法!
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
历史上的今天:
2015-03-27 ADF_Database Develop系列3_设计数据库表之Reconcile Database/Reverse Objects

点击右上角即可分享
微信分享提示