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 if we write return in procedure?

1512


Can you select everything, but 1 or 2 fields, without writer's cramp?

1038


Explain how can you save or place your msg in a table?

1075


What is sql rowcount?

1070


What are the different datatypes available in PL/SQL?

1146


What are the various levels of constraints?

1167


How global cursor can be declare with dynamic trigger ?

2270


Can I learn sql in a week?

1119


What is offset and limit in sql?

1104


Explain constraints in sql?

1086


What is bulk compiling in pl/sql.?

1190


How can we avoid duplicating records in a query?

1031


How do temporal tables work?

1018


how to enter binary numbers in sql statements? : Sql dba

1011


How to use transactions efficiently : transact sql

1115