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
What is the difference between python and sql?
What is input buffer in sql*plus?
what is the difference between primary key and unique key? : Sql dba
What is the most important ddl statements in sql are?
What are all the different normalizations?
what are null values? : Sql dba
What is a full join sql?
How does join work in sql?
What are instead of triggers?
What are the two parts of design view?
Explain the steps needed to create the scheduled job?
What is difference between nchar and nvarchar?
What is cursor explain with example?
What is the sql query to display the current date?
what are the advantages of using stored procedures? : Sql dba