首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > 其他数据库 >

oracle札记二(常用各类函数)

2012-09-09 
oracle笔记二(常用各类函数)条件表达式1.case exp1 when…then…else…end(exp1不可为空或比较运算符)2.decod

oracle笔记二(常用各类函数)
条件表达式
1.case exp1 when…then…else…end(exp1不可为空或比较运算符)
2.decode(exp1,search1,result1,search2,result2…,result)

分组函数(组函数忽略空值)
1.avg
2.max
3.min
4.sum
5.count

查找当前用户名下的所有表
Select table_name from user_tables;

非等值连接(between…and…)
Select e.ename,e.sal,s.grade
From emp e,salgrade s
Where e.sal between s.losal and hisal;

外连接
左外连接
Select e.ename,d.dname,e.deptno
From emp e,dept d
Where e.deptno=d.deptno(+)
右外连接
Select e.ename,d.dname,d.deptno
From emp e,dept d
Where e.deptno(+)=d.deptno;

热点排行