Is it compulsory to sepcify order by clause in window if we use row_number() in analytical function ?
Is it compulsory to sepcify order by clause in window if we use row_number() in analytical function ?
Last edited by babi_geek; 03-15-2008 at 06:44 AM.
u need to use order by because It assigns a unique number to each row to which it is applied in the ordered sequence of rows specified in the order_by_clause, beginning with 1.
Where can I get oracle documentation for analytical functions?
I have searched SQL Documentation. I did not find explanation for analytical functions.
Follow this link
http://download.oracle.com/docs/cd/B...lysis.htm#1020
Use this link
What is difference between ROLLUP and CUBE functions.
Syntax for both these functions is same
SELECT ... GROUP BY CUBE (grouping_column_reference_list)
SELECT ... GROUP BY ROLLUP(grouping_column_reference_list)
Both these functions are used for calculating totals only.
Could anyone make it clear with one example?
SELECT
deptno,job, sum(sal) FROM scott.emp
GROUP BY ROLLUP(deptno,job);
SELECT
deptno, job,sum(sal) FROM scott.emp
GROUP BY CUBE(deptno,job);
From the above two queries u can find the difference
Please find a related article here.
Cube and rollup are extension to group by or analytical functions?
They are not displaying group results along with rows. They are displaying only one result per one group.
Please clarify me whether they are analytical functions or not?
I think they are not analytical functions. Just extention to group by functionality.