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 / shekaran04
Hi,
First thing you cannot use " ROWNUM > (somthing) "
And to get last three records...
Select *from emp
minus
Select *from emp where rownum <(select Count(*) from emp)-
3;
Good Luck...
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
What are the parts of a basic sql query?
What is varchar used for?
Should I use mbr or gpt?
What is int identity in sql?
What is difference between rank () row_number () and dense_rank () in sql?
How do you take the union of two tables in sql?
Can we call stored procedure in function?
What are the different tcl commands in sql?
What is the difference between sql and t sql?
What is a schema? How is it useful in sql servers?
what is bcp? When is it used?
How do I copy a table in sql?
which command using query analyzer will give you the version of sql server and operating system? : Sql dba
Write a unique difference between a function and a stored procedure.
How do you explain an index number?