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 / alok narayan
select * from (select * from emp order by rowid desc )
where rownum <= 3 order by rowid;
| Is This Answer Correct ? | 6 Yes | 0 No |
Post New Answer View All Answers
what is the difference between clustered and non clustered index in sql? : Sql dba
table structure: ---------------- col1 col2 ----- ----- 01-mar-2012 11:12:46 01-mar-2012 11:12:10 01-mar-2012 11:12:46 01-mar-2012 11:11:23 Write a query to display the result as shown below: col1 col2 ----- ----- 01-mar-2012 11:12:46 01-mar-2012 11:12:10
What is coalesce sql?
how are mysql timestamps seen to a user? : Sql dba
what is difference between delete and truncate commands? : Sql dba
What are the benefits of pl sql?
What is dba in sql? : SQL DBA
How much does sqlite cost?
Can you rollback after commit?
What is the difference between the repeatable read and serializable isolation levels? : Transact sql
what are properties of a transaction? : Sql dba
Why select is used in sql?
Is record in oracle pl sql?
How would you convert date into julian date format?
How do you identify a primary key?