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?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain a private synonyms?

639


If youre unsure in which script a sys or system-owned object is created, but you know its in a script from a specific directory, what UNIX command from that directory structure can you run to find your answer?

1661


What is execute immediate in oracle?

549


What is a cursor variable?

580


How to update values on multiple rows in oracle?

603






What is catalog in Oracle?

655


How to do clean up if create database failed?

576


How do I use unicode codesets with the weblogic jdriver for oracle driver?

557


How to create id with auto_increment on oracle?

547


How to convert numbers to characters in oracle?

590


How many file formats are supported to export data?

661


What is a sub query? Describe its types?

550


Give the various exception types.

551


How to define an explicit cursor in oracle?

604


Differentiate between post-database commit and post-form commit?

545