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

SELECT empno
FROM (SELECT ROWNUM r, emp_code
FROM emp
ORDER BY empno DESC) t1
WHERE t1.r <= 3

Is This Answer Correct ?    9 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is function and procedure in pl sql?

1024


What is normalization in a database?

1142


Explain isolation levels. : Transact sql

1046


What is difference between function and trigger?

1021


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

996


What do you mean by field in sql?

1068


Enlist some predefined exceptions?

1037


What is compute?

1071


What are all the common sql functions?

998


Is sql a case sensitive language?

915


Is record in pl sql?

948


What is sql and also describe types of sql statements?

1037


Define union, minus, union all, intersect ?

985


What is sql mysql pl sql oracle?

1057


Which command is used to delete a package?

1148