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 / gnreddy
try this one.
select * from emp where 3 >( select count(1) from emp e where e.rowid > emp.rowid);
| Is This Answer Correct ? | 7 Yes | 4 No |
Post New Answer View All Answers
What is #table in sql?
Which software is used for pl sql programming?
What is before trigger?
How do you declare a variable in pl sql?
what are the nonstandard string types? : Sql dba
How is data stored in sql?
Is it mandatory for the primary key to be given a value when a new record is inserted?
what is myisam? : Sql dba
What is dense_rank in sql?
How can we make an if statement within a select statement?
Is sql easier than java?
What is rename command in sql?
What is the default isolation level in sql server? : Transact sql
When should I use nosql database?
Which is better varchar or nvarchar?