Table E:
Name dept month sal
1 A JAN 800
2 B APR 1000
3 A JAN 300
4 A JAN 600
5 C JUN 400
1) SELECT HIGHEST SAL PAID DEPT IN JAN MONTH?
2) WRITE QUERY GET MAX SAL DEPT NO?
Answers were Sorted based on User's Feedback
Answer / parag
1) SELECT DISTINCT DEPT FROM TABLE
WHERE SAL >=
(SELECT MAX(SAL) FROM TABLE
WHERE MONTH = 'JAN');
2) SELECT DISTINCT DEPT, SAL FROM TABLE
WHERE SAL >=
(SELECT MAX(SAL) FROM TABLE);
| Is This Answer Correct ? | 3 Yes | 1 No |
Answer / suman rana
select dept from ( select dept,
max(sal) over() maxsal,
sal from ( select dept,
max(sal) sal
from E
where month=JAN'
group by dept
)
) WHERE maxsal = sal;
select distinct dept from ( select dept, max(sal) over ()
maxsal, sal
from E
)
where maxsal = sal;
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / venkateswara reddy
1)select dept from E where sal=(select max(sal) from E where
month='JAN')
2)select dept from E where sal=(select max(sal) from E)
| Is This Answer Correct ? | 0 Yes | 1 No |
Answer / shilpa
1) select dept , max(sal) from E where month=JAN';
2) select dept , max(sal) from E ;
| Is This Answer Correct ? | 1 Yes | 2 No |
Answer / shilpa
1) select dept , max(sal) from E where month=JAN';
2) select dept , max(sal) from E ;
| Is This Answer Correct ? | 1 Yes | 3 No |
Answer / mayur
select max(sal) from e where sal in (select month form e
where month = 'JAN';
| Is This Answer Correct ? | 0 Yes | 5 No |
What is the difference between hot backup and cold backup in oracle? Tell about their benefits also.
What are the sql clauses supported in the link property sheet ?
How do I spool to a csv formatted file using sqlplus?
What happens internally when the user types userID/password@string in SQL PLUS Thanks-Bhaskar
What are the different types of synonyms?
How to update a table row with a record?
What is ASM (Automatic Storage Management) in Oracle?
What are joins..how many types of joins are there?
29 Answers Amdocs, CSC, TCS,
What are the Referential actions supported by FOREIGN KEY integrity constraint ?
What is a named program unit?
How many file formats are supported to export data?
Where do we use decode and case statements?