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
Where can I learn sql for free?
what is subquery? : Sql dba
what does the t-sql command ident_current does? : Transact sql
What is primary key and foreign key with example?
Explain how to use transactions efficiently : transact sql
What are the properties of a transaction?
When is the update_statistics command used?
Is sql a dbms?
How many scalar data types are supported in pl/sql?
What is procedure and function in sql?
How do I remove all records from a table?
What is a sql instance vs database?
What does dml mean?
Does oracle roll back the transaction on an error?
What is an example of translating a date into julian format?