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

Answer Posted / nani

select * from emp a where &N > (select count(*) from emp b
where b.rowid > a.rowid)

N = No.of rows.

Is This Answer Correct ?    8 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what are the types of join and explain each? : Sql dba

769


What is the difference between a query and a report?

680


what is top in tsql? : Transact sql

735


Mention what problem one might face while writing log information to a data-base table in pl/sql?

871


what is a cursor? : Sql dba

745






How does sql store data?

663


how can we know the count/number of elements of an array? : Sql dba

772


How you can copy a file to file content and file to pl/sql table in advance pl/sql?

818


What are the query optimization techniques?

711


what is the stuff function and how does it differ from the replace function? : Sql dba

788


what is the difference between mysql_fetch_object and mysql_fetch_array? : Sql dba

732


How to avoid using cursors?

767


Can we insert data into materialized view?

710


what is try_catch block in procedure

1393


How do I create a memory optimized filegroup?

697