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 CAN I FIND MAX SAL ,ENAME FROM EMP TABLE.

Answer Posted / kanhu charan biswal

select ename, sal from emp where sal=(select max(sal) from
emp);

For see the max(sal) with ename departmentwise the query
will be:
select ename,sal from emp a
where sal in (select max(sal) from emp group by deptno);

For findout the nth highest salary with name, the query
will be:

select ename,sal from emp a
where &n=(select count(distinct sal) from emp b
where b.sal>=a.sal)
after execute the query it will ask you to pass a value
for 'n'.it stands for nth hiest salary

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between partition and index?

949


How can I make sql query run faster?

979


What are all the different normalizations?

997


What are reports usually used for?

986


What is the difference between microsoft sql and mysql?

937


What are the advantages of pl sql?

1091


what are null values? : Sql dba

915


What is difference between procedure and trigger?

938


Is sql considered coding?

1011


What are the popular database management systems in the it industry?

945


What is composite primary key in sql?

957


What is flag in sql?

1002


Explain the types of joins in sql?

988


How do I save the results of sql query in a file?

949


Is left join faster than join?

1000