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 are different sql data types?

1053


Write a sql select query that only returns each name only once from a table?

1023


What are expressions?

1019


What is the purpose of normalization?

1049


How do I sort a table in sql?

1051


What is union, minus and interact commands?

1302


what are the different type of normalization? : Sql dba

1032


What is meaning of <> in sql?

1075


How does index help in query performance?

1032


What is sql analyzer?

1026


Are stored procedures compiled?

932


Which are the different types of indexes in sql?

1064


What is a dynamic query?

1030


what are the join types in tsql? : Transact sql

1068


How is use pl and sql?

1068