Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

How do I upgrade sql?

998


what is cross join? : Sql dba

992


What is sql integrity?

1145


How do you use collections in procedure to return the resultset?

2236


What are aggregate functions in sql?

1154


How does a trigger work?

1062


what is the syntax used for partition in tsql? : Transact sql

1013


What is aggregate function in sql?

1030


What is the mutating table and constraining table?

1023


Name some usages of database trigger?

1016


what is the difference between delete and truncate commands? : Sql dba

1064


What is a rank in sql?

957


What is an invalid partition table?

1022


How do you take the union of two tables in sql?

980


Explain ttitle and btitle.

1116