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!

Get the Max value of a field in an "aggregate"

420246Aug 23 2004 — edited Aug 23 2004
Hello,

I perform the following:
Select prod, color, reference from users where prod='PEN'
I get:
PEN BLUE 1234
PEN BLUE 7885
PEN RED 1111
PEN RED 2222
PEN BLUE 9999

But I want to get:
PEN BLUE 9999
PEN RED 2222

I mean I need only one line by (PROD,COLOR) with the max for the reference.

How should I proceed ?

Any help is greatly appreciated.
Regards,
Jerome

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 20 2004
Added on Aug 23 2004
2 comments
145 views