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 / alok narayan
select * from (select * from emp order by rowid desc )
where rownum <= 3 order by rowid;
Is This Answer Correct ? | 6 Yes | 0 No |
Post New Answer View All Answers
When a dml statement is executed, in which cursor attributes, the outcome of the statement is saved?
What are sql indexes?
What is difference between stored procedure and trigger?
explain advantages of myisam over innodb? : Sql dba
What are local and global variables and their differences?
Why is a trigger used?
Is like operator in sql case sensitive?
Why having clause is used in sql?
What does pragma mean?
State some properties of relational databases?
How do I install microsoft sql?
Is it possible to read/write files to-and-from PL/SQL?
What is sql entity?
Which one is better subquery or joins?
tell us something about heap tables. : Sql dba