Oracle SQL高级编程--分析函数(窗口函数)全面讲解 注:本文来源于:<Oracle SQL高级编程--分析函数(窗口函数)全面讲解> 概述 分析函数是以一定的方法在一个与当前行相关的结果子集中进行计算,也称为窗口函数.一般结构为 Function(arg1 , arg2 --) over(partition by clause order by clause windowing clause ) Windowing clause : rows | range between star
1.在语句中找到和消除空值 select first_name,last_name from hr.employees where commission_pct is null is null 和 is not null ,null值不跟任何值相等 ,任何值不和null相等,null不等于null. 2.排序 Oracle 支持区分大小写和不区分大小写两种排序方式.有一个环境变量 NLS_SORT 可以控制排序是否区分大小写. 默认是区分大小写的,即 NLS_SORT = BINARY ,大写的
Oracle SQL(二) 条件表达式 CASE 语句 或者DECODE 函数,两者均可实现 IF-THEN-ELSE 的逻辑,相比较而言,DECODE 更加简洁 SELECT last_name ,job_id ,salary ,CASE job_id WHEN 'IT_PROG' THEN 1.10 * salary WHEN 'ST_CLERK' THEN 1.15 * salary WHEN 'SA_REP' THEN 1.20 * salary ELSE salary END as "
From http://blog.csdn.net/wujiandao/article/details/6621073 1. Four ways to get execution plan(anytime you want, for specified sql) • Execute the SQL statement EXPLAIN PLAN, and then query the table where the output was written. • Query a dynamic per