
SQL
cindysaj
这个作者很懒,什么都没留下…
展开
-
ORACLE常用函数和SQL性能忧化
NVL(eExpression1, eExpression2) 如果 eExpression1 的计算结果为 null 值,则 NVL( ) 返回 eExpression2。 如果 eExpression1 的计算结果不是 null 值,则返回 eExpression1。eExpression1 和 eExpression2 可以是任意一种数据类型。 如果 eExpression1 与 eE...原创 2008-12-03 10:33:29 · 86 阅读 · 0 评论 -
decode 查询
查出deptno=20,30部门的人员数和该部门应发的总工资 select e.deptno,count('*'), sum(e.sal)from emp e where deptno in (20,30) group by e.deptno 结果如下: deptno count('*') sum(e.sal) 30 6 9400 20 5 ...2008-12-05 12:23:27 · 216 阅读 · 0 评论 -
子查询小例子
select (select a.ename from emp a where a.empno=7369) aa from emp aa smith smith smith smith smith smith smith smith smith smith smith smith smith smith 一共14条 我觉得 select字段内的子查询是外查...2008-12-05 12:40:02 · 195 阅读 · 0 评论 -
二元值not in与in使用分析
语句 select 'true' from dual where (1,2) not in ((1,3),(3,null)) 结果:true. 1找一个非null元素(范围比较目标项)开始首轮匹配,先匹配第一个元素 2比较元item的第1个元素为1,比较目标item的第1个元素分别为1,3,匹配比较目标item(1,3)成功,故首轮匹配有相等项 3首轮匹配有相等项,进行第2轮比较,限...2008-12-08 18:36:07 · 294 阅读 · 0 评论