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

Answer Posted / sunil bisht

Last 10 record from emp table

select * from emp where rowid<=(select max(rowid) from emp)
minus select * from emp where rowid in(select rowid from
emp where rownum<=3);

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Where the sql database files are stored?

692


Is sql better than excel?

699


How do I save the results of sql query in a file?

711


What is primary and foreign key?

804


what are the differences between get and post methods in form submitting. Give the case where we can use get and we can use post methods? : Sql dba

862






what is an alias command? : Sql dba

727


in oracle 10g sw after compiling procedure how to pass parameter values ,if we (v_empid out number)how to give empid after successful compilation program.This site exact suitable for 10g with respect to question & answer same format , im trying sql browser & sql command prompt using exec procedure name & respective parameters.

1832


What does where 1/2 mean in sql?

760


What is optimistic concurrency control? : Transact sql

746


What is audit logout in sql profiler?

764


What is cursor and its types?

716


What is sharding in sql?

737


What do we need to check in database testing?

724


What are types of joins?

703


how to run 'mysql' commands from a batch file? : Sql dba

777