like  用法介绍:

1、“_”:匹配单个任意字符

oracle like模糊查询简单用法

select * from bqh3 where name like '_崔';

oracle like模糊查询简单用法

 

2、“%”:匹配0个或多个任意字符。但有三种情况如下:

      like %关键字:以关键字开头的记录

      like 关键字%:以关键字结尾的记录

      like %关键字% :包含以关键字的记录

查询以A开头的全部信息

select * from bqh3 where name like 'A%'

oracle like模糊查询简单用法

查询第二个字母以A开头的全部信息:

select * from bqh3 where name like '_A%'

 oracle like模糊查询简单用法

查询字母中有A的字母全部信息:

select * from bqh3 where name like '%A%'

 oracle like模糊查询简单用法

查询字母中不含有A的字母全部信息:

select * from bqh3 where name not like '%A%'

 oracle like模糊查询简单用法

对于like字句,不一定只能在字符串数据上显示,可以在任意的数据上表示:

select * from bqh where SR  like '%9%' or SR like '%5%';

oracle like模糊查询简单用法

oracle like模糊查询简单用法

注意:不设置任何的查询关键字的话(’%%’)则表示查询全部记录

-------------------------------------------------------------------------------------

感谢您的阅读,如果您觉得阅读本文对您有帮助,请点一下“推荐”按钮。本文欢迎各位转载,但是转载文章之后必须在文章页面中给出作者和原文连接。

 

相关文章:

  • 2021-08-07
  • 2021-06-23
  • 2021-05-14
  • 2021-10-04
  • 2022-02-06
  • 2021-10-17
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-01
  • 2021-10-04
  • 2022-12-23
  • 2021-09-03
相关资源
相似解决方案