![]() |
|||
|
|
|||
|
||||||||||||||||||||||||||||||
|
|
|
Looking for the original pages? (formerly called "Morgan's Library") You can find them here.
Term: SUM
Definition: SUM(expression) Analytic Usage: SUM([DISTINCT | ALL] expression) OVER (partition clause) Example Usage: Aggregate Use The SQL query below displays total salary of all employees in each department. SELECT DEPT, SUM(SAL) SUM_SAL Analytic Use The query above can be reframed in order to demonstrate the analytic behavior of the SUM function: SELECT DISTINCT DEPT, SUM(SAL) OVER (PARTITION BY DEPT ORDER_BY DEPT) SUM_SAL Related Links:
Related Code Snippets:
|
| Home : Code Library : Sponsors : Privacy : Terms of Use : Contact Us | 70 users online © 2009 psoug.org |