Oracle学习4:distinct、between and、in、like详解
来源:互联网 发布:编程培训加盟 编辑:程序博客网 时间:2024/06/08 08:43
1.distinct
distinct A,B 用于取出不同的组合记录。
取出不同的雇员
select distinct employee from test_ljb;
取出雇员和薪水的不同组合。
select distinct t.employee, t.salary from test_ljb t;
2.between a and b [a,b]
等价于数学中的[a,b],闭区间,包括边界。
取出薪水在1000-1500的薪水。
select t.salary from test_ljb t where 1=1 and t.salary between 1000 and 1500;
等价于
select t.salary from test_ljb t where 1=1 and t.salary >=1000 and t.salary <=1500;
3.in(’ ‘,’ ‘)
选取处于in表达式里的数据。
select t.employee, t.salary from test_ljb t where t.salary in (1000,1500,2000);
4.is(is not)
select t.* from test_ljb t where t.bonus is null;
select t.* from test_ljb t where t.bonus is not null;
5.like及通配符、转移字符
%
:任意多个任意字符 (>=0) _
:一个任意字符 (= 1)
选取名字中包含a的雇员
select t.employee from test_ljb t where t.employee like '%a%';
选取第二个字母为a的雇员
select t.employee from test_ljb t where t.employee like '_a%';
选取姓名中包含’%’的雇员
select t.employee from test_ljb t where t.employee like '%\%%' escape '\';
escape用于指定转义字符,当然我们可以指定其他的转移字符。如:
select t.employee from test_ljb t where t.employee like '%*%%' escape '*';
阅读全文
0 0
- Oracle学习4:distinct、between and、in、like详解
- day17 oracle ----查询(select) ---(BETWEEN ... AND... ,IN(list), LIKE , IS NULL , AND ,OR, NOT) ---(字符 , 数字 ,日期, 转换
- where查询条件的指定,between and,in,like
- select 语法+别名的使用+连接运算符+distinct+where+like+转义字符+between+in
- SQL in ASP: LIKE, NOT LIKE & BETWEEN
- 绑定变量,between...and...,in,not in,通配符_和%,distinct
- The distinct between jdk and jre[转]
- distinct between point and line (for svm)
- Difference between Select Unique and Select Distinct
- The difference between EXISTS and IN upon Oracle
- Oracle数据库的in,between...and操作符的理解
- Oracle IN 与 DISTINCT
- oracle between and 边界问题
- Oracle between and 边界问题
- oracle 中的IN,LIke
- 六.sql server 中distinct,and,between and的用法
- The distinct interpretation of the $(),${} between make and shell
- the different between function and procedure in oracle oracle 中函数和存储过程的区别
- java获取cpu数量
- boost 定时器 demo
- 博客第三篇
- .Net文档图像处理工具包GdPicture.NET发布v14.0.29,改进OCR功能
- 数据结构课设之家谱管理系统
- Oracle学习4:distinct、between and、in、like详解
- Spring Boot 整合ActiveMQ的过程
- webpack学习
- 一个简单的图片加载器android
- 高质量子程序特点
- maven多工程应用,spring MAVEN多个子模块之间的调用
- CSS深入理解之margin
- PXE自动化部署操作系统
- SQLite实现用户登录功能