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 / alok narayan
select * from (select * from emp order by rowid desc )
where rownum <= 3 order by rowid;
| Is This Answer Correct ? | 6 Yes | 0 No |
Post New Answer View All Answers
What is sql lookup?
How do I run a sql query?
Why commit is not used in triggers?
what is the difference between ereg_replace() and eregi_replace()? : Sql dba
What is sqlite format?
Explain how you can copy a file to file content and file to pl/sql table in advance pl/sql?
Which is better varchar or nvarchar?
explain the advantages and disadvantages of stored procedure? : Sql dba
What is trigger types in sql?
what are aggregate and scalar functions? : Sql dba
What is difference between db2 and sql?
What is pl sql collection?
What are the query optimization techniques?
How do I count rows in sql?
How does sql*loader handles newline characters in a record? : aql loader