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

What is a subquery in sql?

1000


Can we use update in sql function?

1028


What is normalization in a database?

1129


What is mutating sql table?

1067


what is sql in mysql? : Sql dba

1150


what is meant by nl2br()? : Sql dba

996


What is pl sql package?

1009


what happens when the column is set to auto increment and you reach the maximum value for that table? : Sql dba

1005


What operating systems are supported by oracle sql developer?

922


What are all the common sql functions?

988


What are sql built in functions?

908


Any attempt to navigate programmatically to disabled form in a call_form stack is allowed?

1061


What are the types of index in sql?

1039


What is data control language (dcl)?

1092


What is the difference between distinct and unique in sql?

900