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
How do I start sql profiler?
Is ms sql traffic encrypted?
What is the difference between syntax error and runtime error?
How do I add a primary key to a table?
Why select is used in sql?
what is timestamp in mysql? : Sql dba
Does inner join return duplicate rows?
what are the limitations of mysql in comparison of oracle? Mysql vs. Oracle. : Sql dba
What is the difference between inner join and natural join?
What is sql basics?
Does truncate require commit?
what is union, minus and interact commands? : Sql dba
How can we find duplicate records in a table?
Can we join 3 tables in sql?
What sql does db2 use?