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 / mah6326955
SELECT empno
FROM (SELECT ROWNUM r, emp_code
FROM emp
ORDER BY empno DESC) t1
WHERE t1.r <= 3
| Is This Answer Correct ? | 9 Yes | 4 No |
Post New Answer View All Answers
How to combine two stored procedures in sql?
what is heap table? : Sql dba
What are the different schemas objects that can be created using pl/sql?
Does sql*plus also have a pl/sql engine?
Can we call a function containing dml statements in a select query?
What are basic techniques of indexing?
How much does sqlite cost?
Explain what is rdbms?
How do you delete a table?
Can we insert delete data in view?
What is pl sql in oracle?
What are sql data types?
what are date and time data types in mysql? : Sql dba
What are sql*plus environment variables?
Why we use pl sql?