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 / arvind kumar
select * from employees minus select * from employees where
rownum < (select count(*)-2 from employees);
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What types of commands can be executed in sql*plus?
What is sql select statement?
What is foreign key in sql with example?
does sql support programming? : Sql dba
Can a select statement fire a trigger?
How do you rename a table in sql?
how can we optimize or increase the speed of a mysql select query? : Sql dba
How to use transactions efficiently : transact sql
What is embedded sql with example?
What is dba in sql? : SQL DBA
What is sqlcommand?
What are the two types of exceptions.
Can you select everything, but 1 or 2 fields, without writer's cramp?
How do I count rows in sql?
How to call a javascript function from pl sql?