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 / sanjay

SELECT ROWNUM AS rank, employee_id
FROM (SELECT employee_id
FROM employees
ORDER BY employee_id DESC)
WHERE ROWNUM<=3

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do I start sql profiler?

978


Is ms sql traffic encrypted?

909


What is the difference between syntax error and runtime error?

1119


How do I add a primary key to a table?

1028


Why select is used in sql?

1001


what is timestamp in mysql? : Sql dba

1055


Does inner join return duplicate rows?

962


what are the limitations of mysql in comparison of oracle? Mysql vs. Oracle. : Sql dba

940


What is the difference between inner join and natural join?

990


What is sql basics?

1029


Does truncate require commit?

955


what is union, minus and interact commands? : Sql dba

1168


How can we find duplicate records in a table?

927


Can we join 3 tables in sql?

1004


What sql does db2 use?

963