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

- Types of triggers - View - Dcl - Procedures, packages, functions - Metasolve - Can use Dcl in triggers - package case study - Cursor and its types - triggers schedule - Wrap - Why we are using fetch and for in cursor. difference?

1818


How do I pipe the output of one isql to another?

990


What is secondary key?

920


What is form and report?

961


What is varchar data type in sql?

1062


Differentiate between % rowtype and type record.

1278


What are the types of join and explain each?

1021


What are the most important characteristics of pl/sql?

1135


What is the difference between nested table and varray?

993


Which is faster truncate or drop?

1031


Which is better join or subquery?

1120


What is the difference between jpql and sql?

1074


What is a data definition language?

1079


Which is better join or inner query?

1019


Mention what does plv msg allows you to do?

1097