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
Rownum assigned at the runtime on the basis of rownum you
not fetch last three records.
for no records output: Rownum always use <= or >= , if use
rownum < or > its giving no output.
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What are the various restrictions imposed on view in terms of dml?
How do I write a cron which will run a sql query and mail the results to agroup?
What is record data type?
Explain commit, rollback and savepoint.
What is sql*loader?
What are the advantages of stored procedure?
What is the difference between a subquery and a join?
what are different types of keys in sql?
What is sql analyzer?
what is innodb? : Sql dba
Is sql developer case sensitive?
What is database white box testing and black box testing?
how can we find the number of rows in a table using mysql? : Sql dba
How much does a sql dba make? : SQL DBA
What is orm in sql?