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

select ename from table where sal in
(select max(sal) from table_name
where deptno in ('10','20')
group by deptno);

Is This Answer Correct ?    16 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is user in sql?

764


What is dcl in sql?

697


Which function is used to return remainder in a division operator in sql?

788


what is sql? : Sql dba

742


Can you join views in sql?

721






Can we use rowid as primary key?

738


Why are cursors used?

791


How can you maintain the integrity of your database on instances where deleting an element in a table result in the deletion of the element(s) within another table?

871


What is a behavioral trigger?

697


What are the different sql commands?

724


How do I use google cloud in sql?

732


Why do we create views in sql?

780


What is sql in java?

758


What is sqlservr exe?

699


Can we use join in subquery?

781