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

select * from em where sal in (select max(sal) from em
where dno in (10,20) group by dno) and dno in (10,20)

where em = table name
dno = department number
sal = salary

Is This Answer Correct ?    4 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is sql in mysql? : Sql dba

821


What is sql analyzer?

759


What are the types of keys?

671


what is error ora-03113: end-of-file on communication channel?

822


Is natural join same as inner join?

683






What is cte sql?

718


Are stored procedures compiled?

678


What is a parameter query?

821


What is cursor and its types?

716


What will you get by the cursor attribute sql%found?

702


what are the different tables present in mysql, which type of table is generated when we are creating a table in the following syntax: create table employee (eno int(2),ename varchar(10)) ? : Sql dba

809


How do you modify a trigger?

695


What is nvl?

790


Does view contain data?

788


What is user defined functions?

746