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 / gnreddy
try this one.
select * from emp where 3 >( select count(1) from emp e where e.rowid > emp.rowid);
| Is This Answer Correct ? | 7 Yes | 4 No |
Post New Answer View All Answers
Which software is used for pl sql programming?
how to enter binary numbers in sql statements? : Sql dba
What is pl sql architecture?
what are the differences between binary and varbinary? : Sql dba
How to execute a stored procedure?
What does count (*) do in sql?
how to load data files into tables with 'mysqlimport'? : Sql dba
How do you use a while loop in pl sql?
Explain ddl statements in pl/sql?
How do I edit a stored procedure?
Is pl sql different from sql?
Name three sql operations that perform a sort.
How do I view a sql database?
What are three advantages to using sql?
What is sqlerrd?