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
what is sql in mysql? : Sql dba
What is difference between nchar and nvarchar?
what is the syntax for using sql_variant_property? : Transact sql
What are the disadvantages of file system?
What is input buffer in sql*plus?
Mention what is the use of function "module procedure" in pl/sql?
1. is it possible to use the cursor atttibutes (%found ,% rowcount , %isopen , %notfound ) to our user defined cursor names ....... cursor cursor_name is select * from scott.emp if you use... cursor_name%found , %rowcount ,%isopen,%notfound...will it work... -------------------------- 2.what is the difference between the varray and index by table .. -------- 3. type type_name is table of number(8,3) index by binary_integer; identifier_name type_name; first , last , prior , next ,trim are the methods we can use it for the above type...simillary is there any way to apply for cursors... with thanks and regards..sarao...
What is difference between ms sql and mysql?
What is trigger types of trigger?
What is the difference between subquery and correlated query?
What is difference between stored function and application function?
what are the different type of normalization? : Sql dba
how to check myisam tables for errors? : Sql dba
what is bcp? When is it used?
how many columns can be used for creating index? : Sql dba