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 / avinash
select ename from emp where sal in(select max(sal) from
emp) and deptno in(10,20)
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / praveen reddy.eddula
select ename from emp where sal in(select max(sal) from emp
where deptno in(10,20))
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / swati pise
select top 1 * from table where dept_no in(10,20) order by
sal desc
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / swati
select top 1 ename from emp where deptno in(10,20) order by
sal desc
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / lipika
Select Ename From emp where sal in (Select Max(Sal) From
emp where deptno in (10,20) group by deptno);
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / john
select dept_id,ename max(sal) from employee where dept_id
in ('1','2') group by dept_id;
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / pratdeor
Select ename from table where sal IN
(select Max(sal) over (partition by Deptno) as mxs from table) and Deptno IN (10,20);
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / gautam
select ename,sal from emp
where sal in (select max(sal) from emp group by deptno)
and deptno in (10,20)
Gautam
Is This Answer Correct ? | 3 Yes | 4 No |
Answer / sp
select top 2 ename, salary, dept from dbo.employee where
dept in(10,20) order by salary desc
Is This Answer Correct ? | 1 Yes | 2 No |
need to split a string into seperate values. eg. col1 col2 ---------- 100 - 'a,b,c' 200 - 'a,x,b,d,e' 300 - 'c' result: value count ------------- a - 2 b - 1 c - 2 etc.
explain the difference between bool, tinyint and bit. : Sql dba
How to retrieve a second highest salary from a table? Note:Suppose salaries are in duplicate values eg: Name Sal Malli 60000 Pandi 60000 Rudra 45000 Ravi 45000
10 Answers Mind Tree, Polaris, Sonata,
When are we going to use truncate and delete?
What is an Integrity Constraint?
Why should I use postgresql?
Define concurrency control. : Transact sql
IF i write before / after insert / update trigger and i do rollback what will happen?
write a query find which rows of a table is updated on 2 days before?
hello..... i am an comp science engineering graduate planning to do ORACLE certification in PLSQL 9i. just wanted to know whats the possibility getting job is their openings???? is it worth doin that course n certification
How do I run a sql query in pgadmin 4?
What is schema in sql?