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

Why do we use set serveroutput on?

519


What is sql profiling in oracle?

551


What does pragma mean?

511


Is there a way to automate sql execution from the command-line, batch job or shell script?

557


Does truncate free space?

520






Why is stored procedure faster than query?

496


What are the types of queries in sql?

524


What is nvl?

617


Write a sql query to convert all character to uppercase after hypen.

966


What is record data type?

518


What is cursor in pl sql?

580


What is the difference between the sql*loader and import utilities? : aql loader

601


What is sql and db2?

537


how do you know if your mysql server is alive? : Sql dba

602


Where can I learn sql for free?

509