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 / swastik
SELECT * FROM
(
SELECT * FROM Emp
ORDER BY ROWNUM DESC
)
WHERE ROWNUM <= 3;
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How do I upgrade sql?
what is cross join? : Sql dba
What is sql integrity?
How do you use collections in procedure to return the resultset?
What are aggregate functions in sql?
How does a trigger work?
what is the syntax used for partition in tsql? : Transact sql
What is aggregate function in sql?
What is the mutating table and constraining table?
Name some usages of database trigger?
what is the difference between delete and truncate commands? : Sql dba
What is a rank in sql?
What is an invalid partition table?
How do you take the union of two tables in sql?
Explain ttitle and btitle.