A young Oracle Expert to help you in learning and solving Oracle related queries!!
Sunday, February 10, 2013
How to select last two rows of an Oracle table?
select * from (
select ROW_NUMBER()
OVER (PARTITION BY employee_name ORDER BY emp_code desc) rnum,emp_code from your_table where employee_name='Test'
)
where rnum<=2
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment