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

Can you rollback after commit?

534


What is union and union all keyword in sql and what are their differences?

585


Are there any features that are decommissioned in 11g that are not present in 11g?

1602


Why do we use sql constraints? Which constraints we can use while creating database in sql?

553


How do I edit a stored procedure?

562






what is sql? : Sql dba

562


What is null in pl/sql?

628


how is myisam table stored? : Sql dba

609


What is sql integrity?

585


What is dba in sql? : SQL DBA

541


How many types of normalization are there?

497


How do I pipe the output of one isql to another?

536


What is the process of debugging?

561


What is rank () in sql?

541


What is sql query limit?

512