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 the top 3 salaries of the table using rownum

Answer Posted / phantom coding

select * from (select rownum as rnum,t.* from emp order by
sal desc) a where rnum < 4

the alias to rownum (i.e:rnum) should be used. If rownum is
used for the constraint then the query would return the
first three rows it hits and the results could be wrong.

Is This Answer Correct ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is nosql db?

972


What is sql stand for?

991


What is trigger in pl sql?

1004


What is bulk collect in pl sql?

1092


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

1138


How do you select unique values in sql?

1003


What is a unique key?

1057


Which tcp/ip port does sql server run on? How can it be changed? : Sql dba

1004


Can you have more than one key in a database?

938


What are synonyms in sql?

975


what is user defined functions? : Sql dba

1037


what tools available for managing mysql server? : Sql dba

1088


What is where clause in sql?

1044


What is exit statement?

1020


What is the difference between cluster and non-cluster index?

1108