Oracle花样查询之LIKE模糊查询
来源:互联网 发布:如何下载plc编程软件 编辑:程序博客网 时间:2024/04/28 17:32
1.两个通配符
字符匹配操作可以使用通配符 “%” 和 “_”:
%:表示任意个字符,包括零个;
_:表示一个任意字符;
2.预备工作sqlplus
Connected to aspx?tid=12” target=”_blank” title=”Oracle”>Oracle Database 11g Enterprise Edition Release 11.2.0.1.0
Connected as scott
SQL> select * from dept;
DEPTNO DNAME LOC
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON
3.“%” 和 “_”演示:
SQL> select * from dept where DNAME like ‘_A%’;
DEPTNO DNAME LOC
30 SALES CHICAGO
3.ESCAPE 演示
SQL> insert into dept values(50,’BEIJING’,’HE%BEI’);
1 row inserted
SQL> select * from dept;
DEPTNO DNAME LOC
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON
50 BEIJING HE%BEI
SQL> select * from dept where loc like ‘%\%%’ escape ‘\’;
DEPTNO DNAME LOC
50 BEIJING HE%BEI
SQL> select * from dept where loc like ‘%e%%’ escape ‘e’;
DEPTNO DNAME LOC
50 BEIJING HE%BEI
版权声明
author :shaoduo
原文来自:http://blog.csdn.net/shaoduo/article/details/69220347
其他出处均为转载,原创作品欢迎读者批评指正
- Oracle花样查询之LIKE模糊查询
- oracle like模糊查询
- oracle like 模糊查询
- oracle 模糊查询 like
- Oracle:like模糊查询
- Oracle 模糊查询like %%
- oracle的like模糊查询
- oracle sql语言模糊查询--通配符like
- ORACLE like 下划线 模糊查询 escape
- Oracle模糊查询 like与instr
- oracle like模糊查询的优化测试
- Oracle中like模糊查询及通配符
- Mybatis模糊查询之like写法
- Sql性能优化之LIKE模糊查询
- 模糊查询like小结
- jpa like模糊查询
- linq Like 模糊查询
- SQL like 模糊查询
- C#实现植物大战僵尸修改阳光数值
- swing程序设计3-JTextArea
- Bootstrap工具提示框
- Referenced file contains errors (http://www.springframework.org/schema/beans/spring-beans-3.1.xsd).
- Bootstrap弹出框
- Oracle花样查询之LIKE模糊查询
- Bootstrap警告框
- 学习数据库系统概念,设计及应用心得
- Bootstrap折叠效果
- 数据库完整性约束
- javaSE_06Java中的数组(array)
- Bootstrap折叠实战
- timer 公司内部用法
- 第七章:函数表达式(模仿块级作用域和私有变量)