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...

From an Employee table, how will you display the record
which has a maximum salary?

Answer Posted / pradeep

To get nth rank salary or max salary two ways

below 5th

select ct , empno, sal from (SELECT max(rownum) ct , empno,
sal FROM emp group by empno, sal ORDER BY sal desc) where
ct =5;

below 2nd

select * from (
SELECT DEPTNO,ENAME,SAL,COMM,
RANK() OVER ( ORDER BY SAL DESC, COMM) poK from emp)
where pok =2;

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is dml and ddl?

1011


what is the difference difference between procedure and packages

10549


what is data manipulation language? : Sql dba

1071


What is sql*loader?

1285


how to create a table index in mysql? : Sql dba

1126


How can I get the number of records affected by a stored procedure?

1118


What is a dynamic query?

1073


what is sql in mysql? : Sql dba

1238


what are the advantages and disadvantages of views in a database? : Sql dba

1075


what are aggregate and scalar functions? : Sql dba

1110


What are the three forms of normalization?

1093


What is varchar example?

1080


What is trigger and how to use it in sql?

1070


What is difference between mysql and postgresql?

1238


What does data normalization mean?

1028