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 / gnreddy
try this one.
select * from emp where 3 >( select count(1) from emp e where e.rowid > emp.rowid);
| Is This Answer Correct ? | 7 Yes | 4 No |
Post New Answer View All Answers
How do you break a loop in pl sql?
Define union, minus, union all, intersect ?
What is left join example?
What is the difference between a procedure and a function?
Write a query to find the names of users that begin with "um" in sql?
What are the commands used in sql?
Does sql*plus have a pl/sql engine?
How do you copy a table in sql?
What are stuff and replace function?
How to generate a salary slip like jan 1000 1000 feb 1000 2000 ... dec 1000 12000
How do I truncate a word?
What are the differences between in and exists clause?
Why do we need databases?
What is an escape character in sql?
What is a composite primary key?