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 |
what is global temporary tables and how use that tables in pl/sql packages
What is normalization and types of normalization?
22 Answers Etisbew, F-TEC, Microsoft, TechProcess,
What is normalization sql?
table - new_no old_no 2345 1234 3456 2345 5678 4567 output sud be -new_no 1234 2345 3456 4567 5678
How can you tell the difference between an index and a view?
What is set transaction?
What are the different types of tables in sql?
Can we use update in sql function?
Wat is SGA ?
Define the select into statement.
Does group by remove duplicates?
What is difference between my sql and sql?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)