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

What is index example?

957


What are tables in sql?

999


What are the different types of constraints?

1078


What is the purpose of the primary key?

1010


what is the difference between primary key and unique key? : Sql dba

977


What is case function?

990


how to include character strings in sql statements? : Sql dba

1001


What is pessimistic concurrency control? : Transact sql

1027


what are the drivers in mysql? : Sql dba

987


What is trigger in pl sql with examples?

984


Explain 3 basic parts of a trigger.

1260


Is pl sql still used?

929


how can you create an empty table from an existing table? : Sql dba

1080


what is timestamp in mysql? : Sql dba

1007


State some properties of relational databases?

1005