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 / bikash khuntia

select * from (
select rownum rw,bk.sal from
(select sal from TEMP_SAL order by rowid desc) bk) bik
where bik.rw<=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 subquery works in sql?

1052


what is sub-query? : Transact sql

1079


How many scalar data types are supported in pl/sql?

1025


Explain the significance of the & and && operators in pl sql.

986


Differentiate between sga and pga.

1140


What is data abstraction in sql?

1006


What is varchar used for?

1068


What is vector point function?

1026


Can I call a procedure inside a function?

985


What is the left table in sql?

952


Can we call procedure in select statement?

1033


How do I run a sql trace?

946


Where is sql database stored?

959


What is a schema? How is it useful in sql servers?

1092


Do triggers have restrictions on the usage of large datatypes, such as long and long raw?

1151