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 / sanjay
SELECT ROWNUM AS rank, employee_id
FROM (SELECT employee_id
FROM employees
ORDER BY employee_id DESC)
WHERE ROWNUM<=3
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
What are dml commands?
What are the operators in sql?
What are some emotional triggers?
Define sql delete statement.
Can you skip header records while loading? : aql loader
What is the difference between alter trigger and drop trigger statements?
What is the difference between delete and truncate statement in sql?
What is the maximum database size for sql express?
What are the ways on commenting in a pl/sql code?
what is “go” in t-sql? : Transact sql
What is pl sql collection?
what is a composite key ? : Sql dba
Can dml statements be used in pl/sql?
what is the difference between undefined value and null value? : Sql dba
how can we transpose a table using sql (changing rows to column or vice-versa) ? : Sql dba