how to retrieve last tree records from table?
select *from emp where rownum > (select count(*)-3 from
emp);
i am using this query to get last three records from table
but its not giving any output, so please tell me what is the
error in this query.

Answer Posted / pavithra

select * from emp where rowid in(select rowid from emp
where rownum<=&upto minus select rowid from emp where
rownum<&start)

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How are functions and procedures called in PL/SQL?

586


Is foreign key mandatory?

554


How do I copy a table in sql?

515


How do you update a table in sql?

519


What is the difference between sql and mysql?

551






What is the use of index in sql?

554


Is sql a dbms?

528


Which function is used to return remainder in a division operator in sql?

580


What is varchar data type in sql?

514


Explain the uses of control file.

613


table structure: ---------------- col1 col2 ----- ----- 01-mar-2012 11:12:46 01-mar-2012 11:12:10 01-mar-2012 11:12:46 01-mar-2012 11:11:23 Write a query to display the result as shown below: col1 col2 ----- ----- 01-mar-2012 11:12:46 01-mar-2012 11:12:10

3338


how do you login to mysql using unix shell? : Sql dba

561


What is a scalar value in sql?

580


What is database migration?

517


What are basic techniques of indexing?

842