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 / swastik
SELECT * FROM
(
SELECT * FROM Emp
ORDER BY ROWNUM DESC
)
WHERE ROWNUM <= 3;
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How many tables can a sql database have?
what is not null constraint? : Sql dba
What is input buffer in sql*plus?
What is program debugging?
What is the unique index?
how do you tune the slow running queries in oracle db , explain the methodology
Can we declare a column having number data type and its scale is larger than pricesionex: column_name number(10,100),column_name numbaer(10,-84)
What is memory optimized table?
What is pl sql commands?
What are the types of variables use in pl sql?
What are pl/sql cursors?
What is the command used to fetch the first 5 characters of a string?
What is substitution variable in pl sql?
What is the use of function in sql?
what are the differences between char and varchar? : Sql dba