Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

get month with maximum salary

Krishna Devi VinayakaDec 13 2015 — edited Dec 14 2015

Hi,

I have following table.

create table getmax as(

select 1 empid,2 mnth,5000 salary from dual union all

select 1 empid,10 mnth,6000 salary from dual union all

select 1 empid,12 mnth,5500 salary from dual union all

select 2 empid,3 mnth,7000 salary from dual union all

select 2 empid,7 mnth,6000 salary from dual union all

select 2 empid,12 mnth,5500 salary from dual

);;

I need to get which month employee has the highest salary.

Required Result

========================

EMPID     MONTH     SALARY

========================

1                10               6000

2                 3                7000

=======================

Please help.

This post has been answered by Etbin on Dec 13 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 11 2016
Added on Dec 13 2015
7 comments
595 views