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

Select emplid, sal from (select emplid, sal from
emp_sal_tbl where deptid = 10 order by sal desc) a where
rownum < 2
union
Select emplid, sal from (select emplid, sal from
emp_sal_tbl where deptid = 20 order by sal desc) a where
rownum < 2

Is This Answer Correct ?    0 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

When sql appeared?

623


What are aggregate and scalar functions?

527


What is data type in database?

548


what are all the common sql function? : Sql dba

587


how to extract a unit value from a date and time? : Sql dba

556






Explain normalization and what are the advantages of it?

518


What is rtm in testing?

578


Is ms sql is free?

533


what are the types of subquery? : Sql dba

592


What is composite primary key in sql?

524


How do you create a db file?

523


How do you create a unique index?

575


describe mysql connection using mysql binary. : Sql dba

552


What are the properties of a transaction?

566


Can you inner join the same table?

527