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...

consider a table which contain 4 columns,ename,eno,sal and
deptno, from this table i want to know ename who having
maximum salary in deptno 10 and 20.

Answer Posted / anil pednekar

select table1.ename from (select deptno, max(sal) as sal1
from table1 group by deptno having deptno in(1,2)) as T1,
table1 where T1.deptno=table1.deptno and
T1.sal1=table1.sal

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why do we need cursors in pl sql?

1005


How to create a menu in sqlplus or pl/sql?

1065


How do I quit sql?

900


how to select unique records from a table? : Sql dba

1058


What is sql stand for?

947


Explain the difference between cursor declared in procedures and cursors declared in the package specification?

1062


What is full join in sql?

939


What is rownum in sql?

967


Is it possible to pass parameters to triggers?

1033


What are the features of pl sql?

1015


How much does sql certification cost?

1017


Why use truncate instead of delete?

962


What is an oracle stored procedure?

990


What is acid property in a database?

974


What is data profiling in sql?

1021