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
What is function and procedure in pl sql?
What is normalization in a database?
Explain isolation levels. : Transact sql
What is difference between function and trigger?
what is the syntax used for partition in tsql? : Transact sql
What do you mean by field in sql?
Enlist some predefined exceptions?
What is compute?
What are all the common sql functions?
Is sql a case sensitive language?
Is record in pl sql?
What is sql and also describe types of sql statements?
Define union, minus, union all, intersect ?
What is sql mysql pl sql oracle?
Which command is used to delete a package?