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 / pavithra
select * from emp where rowid in(select rowid from emp
where rownum<=&upto minus select rowid from emp where
rownum<&start)
| Is This Answer Correct ? | 4 Yes | 1 No |
Post New Answer View All Answers
What are the types of optimization?
What does count (*) mean in sql?
How do sql databases work?
What is the importance of sqlcode and sqlerrm?
What is the difference between instead of trigger and after trigger?
What are the types of variables use in pl sql?
How does rowid help in running a query faster?
What is union and union all keyword in sql and what are their differences?
What do we need to check in database testing?
What will you get by the cursor attribute sql%found?
define data blocks ? : Sql dba
What does plv msg allows you to do?
How does a covering index work?
How to run sql*plus commands in sql developer?
what does the t-sql command ident_current does? : Transact sql