Geeks Talk

Prepare for your Next Interview




Analytical functions

This is a discussion on Analytical functions within the Oracle forums, part of the Databases category; Is it compulsory to sepcify order by clause in window if we use row_number() in analytical function ?...


Go Back   Geeks Talk > Databases > Oracle

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 03-15-2008
Contributing Member
 
Join Date: Mar 2008
Posts: 81
Thanks: 14
Thanked 3 Times in 3 Posts
babi_geek is on a distinguished road
Analytical functions

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 07:44 AM.
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 03-15-2008
Expert Member
 
Join Date: Apr 2007
Location: Bangalore
Posts: 462
Thanks: 23
Thanked 57 Times in 56 Posts
susarlasireesha is on a distinguished road
Re: Analytical functions

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.
Reply With Quote
  #3 (permalink)  
Old 03-16-2008
Contributing Member
 
Join Date: Mar 2008
Posts: 81
Thanks: 14
Thanked 3 Times in 3 Posts
babi_geek is on a distinguished road
Re: Analytical functions

Where can I get oracle documentation for analytical functions?
I have searched SQL Documentation. I did not find explanation for analytical functions.
Reply With Quote
  #4 (permalink)  
Old 03-16-2008
Expert Member
 
Join Date: Sep 2007
Posts: 754
Thanks: 22
Thanked 66 Times in 64 Posts
krishnaindia2007 is on a distinguished road
Re: Analytical functions

Follow this link
http://download.oracle.com/docs/cd/B...lysis.htm#1020
Reply With Quote
  #5 (permalink)  
Old 03-16-2008
Expert Member
 
Join Date: Apr 2007
Location: Bangalore
Posts: 462
Thanks: 23
Thanked 57 Times in 56 Posts
susarlasireesha is on a distinguished road
Re: Analytical functions

Quote:
Originally Posted by babi_geek View Post
Where can I get oracle documentation for analytical functions?
I have searched SQL Documentation. I did not find explanation for analytical functions.
Use this link
Reply With Quote
  #6 (permalink)  
Old 03-16-2008
Contributing Member
 
Join Date: Mar 2008
Posts: 81
Thanks: 14
Thanked 3 Times in 3 Posts
babi_geek is on a distinguished road
Re: Analytical functions

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?
Reply With Quote
  #7 (permalink)  
Old 03-17-2008
Expert Member
 
Join Date: Apr 2007
Location: Bangalore
Posts: 462
Thanks: 23
Thanked 57 Times in 56 Posts
susarlasireesha is on a distinguished road
Re: Analytical functions

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
Reply With Quote
  #8 (permalink)  
Old 03-17-2008
Moderator
 
Join Date: Jun 2007
Location: Bangalore,India
Posts: 1,483
Thanks: 8
Thanked 128 Times in 115 Posts
debasisdas will become famous soon enoughdebasisdas will become famous soon enough
Re: Analytical functions

Please find a related article here.
Reply With Quote
  #9 (permalink)  
Old 03-18-2008
Contributing Member
 
Join Date: Mar 2008
Posts: 81
Thanks: 14
Thanked 3 Times in 3 Posts
babi_geek is on a distinguished road
Re: Analytical functions

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?
Reply With Quote
  #10 (permalink)  
Old 03-19-2008
Expert Member
 
Join Date: Sep 2007
Posts: 754
Thanks: 22
Thanked 66 Times in 64 Posts
krishnaindia2007 is on a distinguished road
Re: Analytical functions

I think they are not analytical functions. Just extention to group by functionality.
Reply With Quote
Reply

  Geeks Talk > Databases > Oracle


Thread Tools
Display Modes


Similar Threads

Thread Thread Starter Forum Replies Last Post
On-Line Analytical Processing Lokesh M Data Warehousing 0 12-17-2007 12:56 PM
Web Functions Saitumi Testing Issues 1 12-06-2007 05:48 AM
Features and Functions of QTP Geek_Guest QTP 1 10-08-2007 09:00 AM
Regarding functions in sql Radhi09 SQL 3 04-02-2007 09:29 AM
Functions... jamesravid Brainteasers 3 09-24-2006 05:12 AM


All times are GMT -4. The time now is 01:27 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Copyright © 2008 GeekInterview.com. All Rights Reserved