Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> ***Urgent Question***

***Urgent Question***

From: Local Folders <asmika_at_satyam.net.in>
Date: Wed, 31 Jan 2001 02:23:25 -0800
Message-ID: <F001.002A5647.20010131015022@fatcity.com>

Consider the following case.TABLE :
DEPTempid            
number,deptid
           

number,deptname       
varchar2(30)primary key (empid, deptid)
 

now i want to fetch first seven records from a cursor whose deptid is maximumand empid is minimum. kindly let me know how to write this cursor statement.for example.
 

SQL> select deptid, empid from
dept;
 
 DEPTID  

EMPID---------       
---------        
2     94204        
2     94205        
2     94206        
2     94207        
2     94208        
5     94209        
5     94210        
5     94211        
5     94212        
5     94213        
7     94214        
7     94215        
7     94216        
7     94217        

7     94218
 

15 rows selected.
 

i want output as following by single
query.
 
 DEPTID  
EMPID---------      
---------        
7     94214        
7     94215        
7     94216        
7     94217        
7     94218        
5     94209        

5     94210
 

7 rows selected
 

kindly reply.. thanks in advance.
 

regardsparesh
mehta Received on Wed Jan 31 2001 - 04:23:25 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US