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
What is dml with example?
how can we destroy the session, how can we unset the variable of a session? : Sql dba
Which are the different types of indexes in sql?
What is implicit cursor in pl sql?
Define union, minus, union all, intersect ?
Is oracle sql free?
what are date and time data types in mysql? : Sql dba
What is function and procedure in pl sql?
What does the acronym acid stand for in database management?
How many sql statements are used? Define them.
Can we call a function containing dml statements in a select query?
What is pragma in pl sql?
How to change a value of the field ‘salary’ as 7500 for an employee_name ‘john’ in a table employee_details?
What is minus?
What are the three forms of normalization?