Home » SQL & PL/SQL » SQL & PL/SQL » Query for Retrieving first 2 records of an employee (Oracle 11g)
Query for Retrieving first 2 records of an employee [message #308633] Tue, 25 March 2008 01:58 Go to next message
thisisnatesh
Messages: 92
Registered: March 2007
Member
Hi All,

I need query for retrieving first 2 records
of each employee in table.

Table looks as follows...

   from_Date		   empid
   ---------		   -----	
 01/05/2006                1000           
 01/03/2006                1000
 01/01/2006		   1000           
 04/03/2006                1001              
 04/01/2006                1001              
 01/01/2006                1001
 01/05/2006                1002           
 01/03/2006                1002
 01/01/2006		   1002


Output Should be like



from_Date		   empid
   ---------		   -----	
 01/05/2006                1000           
 01/03/2006                1000
 04/03/2006                1001              
 04/01/2006                1001
 01/05/2006                1002           
 01/03/2006                1002              


Thanks in Advance

Re: Query for Retrieving first 2 records of an employee [message #308636 is a reply to message #308633] Tue, 25 March 2008 02:02 Go to previous messageGo to next message
Michel Cadot
Messages: 68733
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
This a FAQ, please search for Top N

Regards
Michel
Re: Query for Retrieving first 2 records of an employee [message #308639 is a reply to message #308636] Tue, 25 March 2008 02:11 Go to previous messageGo to next message
thisisnatesh
Messages: 92
Registered: March 2007
Member
Thanks Mic
Re: Query for Retrieving first 2 records of an employee [message #308662 is a reply to message #308639] Tue, 25 March 2008 02:46 Go to previous message
Frank
Messages: 7901
Registered: March 2000
Senior Member
Mic? Who is Mic?
Previous Topic: Extract Numeric Value
Next Topic: Display out put format in SQL *plus
Goto Forum:
  


Current Time: Mon Feb 10 03:02:18 CST 2025