【oracle_sql】查找字符串为下划线或百分号字符,使用escape选项来标识

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/debimeng/article/details/84387629

查找字符串为下划线或百分号字符,使用escape选项来标识


如:查找表test中的addr字段以"li_"开头的数据

select * from test where addr like '%\_%' escape '\';

如:查找表test中的addr字段以"li%"开头的数据

select * from test where addr like '%\%%' escape '\';
第一个%是通配符,匹配任意多个字符;
第二个%是要搜素的实际字符;
第三个%是通配符,匹配任意多个字符;

猜你喜欢

转载自blog.csdn.net/debimeng/article/details/84387629