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 is index example?
What are tables in sql?
What are the different types of constraints?
What is the purpose of the primary key?
what is the difference between primary key and unique key? : Sql dba
What is case function?
how to include character strings in sql statements? : Sql dba
What is pessimistic concurrency control? : Transact sql
what are the drivers in mysql? : Sql dba
What is trigger in pl sql with examples?
Explain 3 basic parts of a trigger.
Is pl sql still used?
how can you create an empty table from an existing table? : Sql dba
what is timestamp in mysql? : Sql dba
State some properties of relational databases?