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 / mohammed shahid

select distinct TOP3 from emp order by rownum desc;

Is This Answer Correct ?    2 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the two different parts of the pl/sql packages?

1090


what is the difference between delete and truncate statement in sql? : Sql dba

1250


How much does sql cost?

1011


What does joining a thread mean?

1023


What is a crud api?

956


How subquery works in sql?

1074


What are sql objects?

1083


What are the types of keys?

997


What is keys and its types?

1077


What is rank function in sql?

1031


Is there a way to automate sql execution from the command-line, batch job or shell script?

976


What is a join?

1072


How do you use a while loop in pl sql?

1015


What is over () in sql?

969


What is the difference between the implicit and explicit cursors?

1054