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 / bikash khuntia
select * from (
select rownum rw,bk.sal from
(select sal from TEMP_SAL order by rowid desc) bk) bik
where bik.rw<=3
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How subquery works in sql?
what is sub-query? : Transact sql
How many scalar data types are supported in pl/sql?
Explain the significance of the & and && operators in pl sql.
Differentiate between sga and pga.
What is data abstraction in sql?
What is varchar used for?
What is vector point function?
Can I call a procedure inside a function?
What is the left table in sql?
Can we call procedure in select statement?
How do I run a sql trace?
Where is sql database stored?
What is a schema? How is it useful in sql servers?
Do triggers have restrictions on the usage of large datatypes, such as long and long raw?