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.
Answers were Sorted based on User's Feedback
Answer / sonal
select * from (select ename, deptno,sal
from emp where deptno in(10 , 20)
order by sal desc)
where rownum < =1
Is This Answer Correct ? | 2 Yes | 4 No |
Answer / 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 |
Answer / sumesh s.g
select Name from TBL_Employee
where Salary in(
select max(Salary) from dbo.TBL_Employee
group by DepID
having DepID in(10,20))
--Happy Codding--
Is This Answer Correct ? | 0 Yes | 5 No |
Answer / nancy
Select ename from table where dept_no in ('10','20') group
by dpt_no
Is This Answer Correct ? | 4 Yes | 27 No |
what are sequences
What is a primary key called that is made up of more than one field?
What is a temporal data type?
which tcp/ip port does sql server run on? : Sql dba
What is time based sql injection?
What are the advantages of stored procedure?
How long does it take to learn pl sql?
how many triggers are allowed in mysql table? : Sql dba
How to call shell script from pl sql procedure?
What is difference between stored procedure and trigger?
what is the order of pre-defined exceptions.
Where do we use pl sql?