Analytical_Function_intro1 |
http://www.cs.utexas.edu/users/cannata/dbms/Analytic%20Functions%20in%20Oracle%208i%20and%209i.htm http://www.tutorialnine.com/oracle_sql/sql_functions/var_pop_function.php |
Analytical functions in any DBMS, tender solutions to SQL queries to
compute an aggregated value based of on a group like "Dept No" or
"Job" in a table. Obviously, these operations are used to
segregate/filters/bundles the data into sectors/classes/groups/clusters.
To oversimplify these operations, we may understand these operations
would use
the data obtained from aggregated SQL queries, for further grouping or
segregations. The circles in the image below represent aggregated
functions, and the colored sectors represent the analytical treatments
or operations. In the current context analytical functions are executed
after aggregation functions.
Oracle provides many analytic functions like AVG, |
|
SELECT ename,empno, sal,round( AVG(sal) over
(partition BY deptno order by deptno), 2) AGVSAL, deptno FROM emp
|