Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to select last 3 records from a table?

875255Apr 1 2013 — edited Apr 1 2013
I have a table named HRM_ATTENDANCE
as follows
Name         Type         Nullable Default Comments 
------------ ------------ -------- ------- -------- 
LEAVEDATE    DATE                                   
EMPLOYEECODE VARCHAR2(8)                            
LEAVETYPE    VARCHAR2(4)                            
APPROVEDBY   VARCHAR2(8)  Y                         
FEEDBY       VARCHAR2(8)  Y                         
FEEDTIME     DATE         Y                         
REMARKS      VARCHAR2(50) Y 
the table contains the leave record of employees as follows
LEAVEDATE   EMPLOYEECODE LEAVETYPE APPROVEDBY FEEDBY   FEEDTIME    REMARKS
----------- ------------ --------- ---------- -------- ----------- --------------------------------------------------
6/1/2013    00001        CL  
6/3/2013    00001        EL                                         
6/5/2013    00001        CPL    
6/7/2013    00001        SL 
6/9/2013    00001        CL                                        
I want to select the last 3 leaves(records) of employeecode '00001' while i dont know the what are the leave dates. in easy words i want to select the record where leavedate>='05-jun-2013' but i dont know any of the dates.
This post has been answered by santhosh T on Apr 1 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 29 2013
Added on Apr 1 2013
4 comments
2,563 views