oracle clob like

来源:互联网 发布:网宿科技云计算收入 编辑:程序博客网 时间:2024/04/29 17:16

create table products(
  productid number(10) not null,
  name varchar2(255),
  description CLOB);

查询语句:

select t.productid, t.name from products t

 where dbms_lob.instr(t.description, 'aaa', 1, 1) > 0;

 
在Oracle中,可以使用instr函数对某个字符串进行判断,判断其是否含有指定的字符。其语法为:
instr(sourceString,destString,start,appearPosition).
其中sourceString代表源字符串;destString代表想聪源字符串中查找的子串;start代表查找的开始位置,该参数可选的,默认为1;appearPosition代表想从源字符中查找出第几次出现的destString,该参数也是可选的,默认为1;
如果start的值为负数,那么代表从右往左进行查找。
返回值为:查找到的字符串的位置。

原创粉丝点击