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 / rohan

select empno from emp where (sal,deptno) in ( select max
(sal),deptno from emp where deptno in (10,20) group by
deptno)

Is This Answer Correct ?    13 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Enlist the characteristics of pl/sql?

1235


What do you understand by pl/sql cursors?

546


What is a loop in sql?

562


Mention what does plv msg allows you to do?

662


What is group by in sql?

544






What do you mean by stored procedures?

541


what is offset-fetch filter in tsql? : Transact sql

530


How do you use a while loop in pl sql?

532


how can we submit a form without a submit button? : Sql dba

534


Where do we use pl sql?

547


Why is a trigger used?

519


How do I find duplicates in sql?

501


What is difference between stored procedure and trigger?

529


Are subqueries better than joins?

525


how to dump a table to a file with 'mysqldump'? : Sql dba

544