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

Why do we use view in sql?

907


what is collation? : Sql dba

1077


what is the difference between truncate and drop statements? : Sql dba

1030


How is pl sql different from sql?

1009


what is the use of anchoring object? what r the difference between anchoring object & enclosing object? can any one tell me all the details?

2411


What is the primary key?

876


What is vector point function?

1000


Can unique keys be null?

850


What are tables and fields in the database?

1022


What are the two types of cursors in pl sql?

1001


Does truncate remove indexes?

967


What are the advantages of sql?

1005


What are the types of keys?

926


What is compute?

1010


What is the use of index in hive?

957