How do you retrieve the last N records from a table?

Answer Posted / swastik

 select
 * from
 (
 select  e1.*
 from emp e1
 order by rownum desc
 )
 where rownum <= &n

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how to dump a table to a file with 'mysqldump'? : Sql dba

543


How do I debug a stored procedure?

617


What is sqlservr exe?

474


What is offset and limit in sql?

543


What is varray in pl sql?

559






What is cursor and its types?

548


Explain constraints in sql?

564


What is pl sql package?

585


How to avoid using cursors?

587


What is the life of an sql statement?

517


how many columns can be used for creating index? : Sql dba

511


1) Synonyms 2) Co-related Subquery 3) Different Jobs in Plsql 4) Explain Plan 5) Wrap 6) Query Optimization Technique 7) Bulk Collect 8) Types of index 9) IF primary key is created then the index created ? 10) Foreign Key 11) Exception Handling 12) Difference Between Delete and Trunc 13) Procedure Overloading 14) Grant Revoke 15) Procedure Argument types. 16) Functions. 17) Joins

1142


what is heap table? : Sql dba

601


What is sql architecture?

553


How to place comments in pl/sql?

597