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 are dml commands?

1016


What are the operators in sql?

1023


What are some emotional triggers?

976


Define sql delete statement.

1005


Can you skip header records while loading? : aql loader

1048


What is the difference between alter trigger and drop trigger statements?

1099


What is the difference between delete and truncate statement in sql?

1064


What is the maximum database size for sql express?

1019


What are the ways on commenting in a pl/sql code?

1128


what is “go” in t-sql? : Transact sql

1104


What is pl sql collection?

959


what is a composite key ? : Sql dba

1045


Can dml statements be used in pl/sql?

1071


what is the difference between undefined value and null value? : Sql dba

1094


how can we transpose a table using sql (changing rows to column or vice-versa) ? : Sql dba

947