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
How sql query is executed?
Do we need commit after truncate?
What is a scalar value in sql?
name 3 ways to get an accurate count of the number of records in a table? : Sql dba
how to delete an existing column in a table? : Sql dba
what is a composite key ? : Sql dba
Can I create table without primary key?
What is user defined functions?
Explain scalar functions in sql?
What are sql indexes?
Why do we need pl sql?
What is string data type in sql?
How is use pl and sql?
What is dbo in sql?
Can we join tables without foreign key?