oracle学习笔记1
来源:互联网 发布:三国杀新于吉 淘宝 编辑:程序博客网 时间:2024/05/22 22:51
1. desc用来显示表结构的 desc <table_name> (emp,dept,sal)
2. dual 表结构是用来计算的 只有一个值
select 2*3 from dual ;
名称 是否为空? 类型
----------------------------------------- -------- -----------------
DUMMY VARCHAR2(1)
3. ed 是用来在notepad中显示当前cmd中的命令行的;
4. sysdate 用来显示当前日期
select sysdate from dual;
5. select ename,sal*12 annual_sal from emp; // annual_sal为大写
select ename,sal*12 "annual sal" from emp; //保持原形
6. 如果字段为null,那么与之相关的计算结果也为null,eg: if(comm ==null) then (comm+2) ==null;
7. select ename||sal*12 from emp;
||用来连接字符串的 如果不是字符串那么转化为字符串相当于java中的 "+"
select ename||'adfafasd' from emp;
字符串的表示是用俩个单引号引起来的字符
8. select distinct deptno from emp; // distinct 用来去掉重复结果 显示唯一值
select distinct deptno,job from emp;//组合的唯一;
9. select * from emp where deptno = 10;
10.select * from emp where ename = 'CLARK'; = > < <>
11.select ename,sal from emp where sal between 800 and 1500;
select ename,sal from emp where sal >= 800 and sal<=1500;
12.检索null的字段是用"is null" or "is not null"来作为检索条件
select ename,sal,comm from emp where comm is null;
13.select ename,sal,comm from emp where sal in (800,1500,2000); not in
用来检索奖金为800,1500,2000的相关信息;
14. 模糊查询
select ename from emp where ename like '%ALL%';
15. 转义字符默认为反斜杠 当然也可以用escape来制定其他字符作为转义字符
select ename from emp where ename like '%$%%' escape '$';
- oracle学习笔记1
- oracle学习笔记1
- oracle学习笔记1
- oracle学习笔记1
- oracle学习笔记1
- ORACLE学习笔记1
- Oracle学习笔记(1)
- Oracle学习笔记1
- Oracle 学习笔记 1
- oracle 学习笔记 1
- oracle 学习笔记1
- Oracle 学习笔记1
- oracle学习笔记1
- oracle学习笔记-1
- Oracle学习笔记1
- Oracle学习笔记1
- Oracle学习笔记(1)
- oracle学习笔记-1
- paradox数据库以关键字做字段的查询
- Ehcache 1.5.0 User Guide - Cache Configuration 缓存配置(1)
- 几个关于Windows2003域服务器的链接
- 虚拟地址、线性地址和物理地址之间的关系
- 学习google
- oracle学习笔记1
- call游戏函数
- 解决AJAX CalendarExtender控件不显示中文的情况
- 获取DataGridView选中行的数据的方法
- JAVA中JList的用法
- 不应该不知道C++的常用库
- 开张啦,好烦呀!
- 双系统重装windows后,用grub4dos引导ubuntu9.04的最简洁方法
- 管理理念:让提成方案实现多赢