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 many types of tables are there?

692


how to delete duplicate rows from a join tables(I have three tables on that join) how do you know which join is need to be used? The select statement I have is: SELECT gc_skill_type.skill_type, gc_area_tec.area, gc_technology.technology, gc_technology.id_technology, gc_area_tec.id_area_tec FROM gc_skill_type, gc_area_tec, gc_technology WHERE gc_area_tec.id_skill_type (+) = gc_skill_type.id_skill_type AND gc_technology.id_area_tec (+) = gc_area_tec.id_area_tec order by gc_skill_type.skill_type asc, gc_area_tec.area asc, gc_technology.technology asc

3579


How do you select unique values in sql?

703


What type of database is sql?

774


What is the difference between a database and a relational database?

762






How to pipe multiline string to isql?

758


How do you modify a table in sql?

800


What is mutating error in pl sql?

750


Which command is used to call a stored procedure?

713


How long will it take to learn pl sql?

689


Do ddl statements need commit?

724


Explain the difference between sql and mysql.

753


Is oracle and sql same?

745


Does varchar need length?

712


How to return an array from java to pl/sql?

788