DB2 LIKE escape-expression
来源:互联网 发布:linux下snmpwalk使用 编辑:程序博客网 时间:2024/06/07 03:11
Use @% with the escape character clause:
select *from tblwhere fld like '%@%%' escape '@'
This will search for all records that contain the "%" character in the fld column.
DB2/z has a slightly different format:
select *from tblwhere fld like {escape '@'} '%@%%'
Obviously, you'll need to choose your escape character carefully so it won't interfere with the rest of your string but this is relatively easy for static strings. Dynamically built strings will require dynamically built queries so that it doesn't use a character from the string.
SELECT DISTINCT COL2, COL7,COL6FROM TEST.IMPORTDATA1 WHERE IMPORTDATA1.COL6 like '%@_10' escape '@'
SELECT DISTINCT COL2, COL7,COL6FROM TEST.IMPORTDATA1 WHERE IMPORTDATA1.COL6 like '%__10' escape '_'
参考如下:
Use @%
with the escape character clause:
select *from tblwhere fld like '%@%%' escape '@'
This will search for all records that contain the "%"
character in the fld
column.
DB2/z has a slightly different format:
select *from tblwhere fld like {escape '@'} '%@%%'
Obviously, you'll need to choose your escape character carefully so it won't interfere with the rest of your string but this is relatively easy for static strings. Dynamically built strings will require dynamically built queries so that it doesn't use a character from the string.
- DB2 LIKE escape-expression
- Oracle LIKE ESCAPE子句
- 小谈LIKE中的ESCAPE
- sql like 通配符 % _ escape
- DB2中like使用
- DB2的like详解
- SQL Like 通配符特殊用法:Escape
- SQL Server like escape的使用方法
- ORACLE like 下划线 模糊查询 escape
- SQL Server like escape的使用方法
- DB2 实现 ORACLE LIKE 关联
- DB2的create table like
- db2 sql like 带下划线
- 在db2中替换like的办法
- ibatis like mysql oracle sqlserver db2
- oracle中的like 和DB2中的locate
- where content like '/_,/_,/_,/_,%' escape '/';
- SQL Server:SQL Like 通配符特殊用法:Escape
- Linux下autoconf和automake使用
- MFC如何添加菜单快捷键
- 基站定位平台接口协议
- sharding系列好文收藏
- 另外八小时,用辛勤换幸福
- DB2 LIKE escape-expression
- VC++2010 使用 MySql++
- Ubuntu右上角通知栏中的图标不见了,如何恢复?
- 大数取模 poj2635
- DTO理论与实践
- profile与bashrc的深入分析(收集网上的几篇精品文章-- 不断更新中)
- 软件随想录:程序员部落酋长Joel谈软件(local.joelonsoftware.com/wiki)-23
- 打开cad文件的几种方法
- 利用BeanUtils在对象间复制属性