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
what is the difference between where clause and having clause? : Sql dba
what is bcp? When does it used? : Sql dba
What do you mean by dbms? What are its different types?
column A column b | output 10 7 | 10 5 8 | 8 7 -9 | 7 3 5 | 5 0 6 | 6 Write a sql query to print such output.
How do I edit a trigger in sql developer?
What is a memo field?
Will truncate release space?
How can I make sql query run faster?
Why does sql need a server?
What is cursor status?
What is the difference between the repeatable read and serializable isolation levels? : Transact sql
How do I remove duplicates in two columns?
What is record in pl sql?
What is input buffer in sql*plus?
What is meant by truncate in sql?