oracle怎么判断是否包含字符

来自:互联网
时间:2022-05-24
阅读:
免费资源网 - https://freexyz.cn/

Oracle怎么判断是否包含字符

1、使用通配符“%”

语法类似:

select * from students where 字段 like ‘%字符%’

示例如下:

oracle怎么判断是否包含字符

2.使用contAIns函数

语法为:

select * from table1 where contains(字段, ‘字符’);

示例如下:

oracle怎么判断是否包含字符

使用contains谓词有个条件,那就是列要建立索引,也就是说如果上面语句中table1表的Column1列没有建立索引,那么就会报错,局限性比较大。

3.使用instr函数

语法为:

select * from table1 where instr(字段,'字符') > 0 ;

示例如下:

oracle怎么判断是否包含字符

免费资源网 - https://freexyz.cn/
返回顶部
顶部