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

Can we use insert statement in function?

1007


how to concatenate two character strings? : Sql dba

1110


give the syntax of grant and revoke commands? : Sql dba

1160


Is sql harder than python?

1111


What is sql*plus?

1084


Can two tables have same primary key?

985


what are the join types in tsql? : Transact sql

1072


explain what is mysql? : Sql dba

1090


what is the stuff function and how does it differ from the replace function? : Sql dba

1062


how to get help information from the server? : Sql dba

949


What will you get by the cursor attribute sql%rowcount?

1045


What is varray in pl sql?

1085


Write a unique difference between a function and a stored procedure.

1009


what are null values? : Sql dba

963


how to convert character strings to dates? : Sql dba

1071