dbTalk Databases Forums  

How to select N no. of row for each group

comp.database.oracle comp.database.oracle


Discuss How to select N no. of row for each group in the comp.database.oracle forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Mir
 
Posts: n/a

Default How to select N no. of row for each group - 05-18-2004 , 02:15 PM






Deptno Dname
------ -----
10 ACCOUNTS
20 SALES
30 MARKETING
40 RESEARCH

i want a query which will select lets say first 5 employees for each deptno.

Thanks

Reply With Quote
  #2  
Old   
Yosua
 
Posts: n/a

Default Re: How to select N no. of row for each group - 05-28-2004 , 02:01 PM






use COUNT() along with GROUP BY
sorry I was not able to give an example
"Mir" <mhyder (AT) rice (DOT) edu> wrote

Quote:
Deptno Dname
------ -----
10 ACCOUNTS
20 SALES
30 MARKETING
40 RESEARCH

i want a query which will select lets say first 5 employees for each
deptno.

Thanks



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.