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 an invalid partition table?

1026


Is sql easier than java?

1018


how can we know the count/number of elements of an array? : Sql dba

1064


how to use 'mysql' to run sql statements? : Sql dba

1056


what are the advantages a stored procedure? : Sql dba

978


Explain unique key in sql.

1017


What is dynamic query?

982


what is myisam? : Sql dba

1087


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

1249


What is sql server and ase?

1029


how to use case expression? : Sql dba

1031


What is the difference between pl and sql?

1096


What is union?

1174


Explain polymorphism in pl/sql.

1123


What is bitemporal narrowing?

1312