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
Can we create table inside stored procedure?
Why are aggregate functions called so?
Explian rowid, rownum? What are the psoducolumns we have?
what are the different tables present in mysql? : Sql dba
Is it possible to Restore a Dropped Table using Rollback Command in Oracle SQL Plus ?
write an sql query to find names of employee start with 'a'? : Sql dba
What is the use of count (*) in sql?
How exception handling is done in advance pl/sql?
What are the ways on commenting in a pl/sql code?
Can we enter data in a table in design view?
What is a rank in sql?
What is the difference between partition and index?
Can a foreign key be a duplicate?
what is the difference between delete and truncate statement in sql? : Sql dba
Do prepared statements prevent sql injection?