HI Art
Just realized
Are you asking for the one record with the highest qty or the styles and classes with the highest qty for each style and class (which is what I just gave you)
Sent via the Samsung GALAXY S® 5, an AT&T 4G LTE smartphone
-------- Original message --------
From: Alan Shore <ashore@xxxxxxxx>
Date: 5/29/18 8:46 PM (GMT-05:00)
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
Subject: RE: [EXTERNAL] Sql select max value question
HI Art
Not near a machine at the moment, but what you are asking for is to compare the same file against itself where a.style = b.style and a.class = b.class and a.qty gt or = max (b.qty)
I had to use gt
Cannot find the greater than sign
Hope this makes sense
Sent via the Samsung GALAXY S® 5, an AT&T 4G LTE smartphone
-------- Original message --------
From: "Art Tostaine, Jr." <atostaine@xxxxxxxxx>
Date: 5/29/18 8:30 PM (GMT-05:00)
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
Subject: [EXTERNAL] Sql select max value question
I have a table with 3 columns, style, class, quantity
There are many classes for each style. I want my select to return only the
class with the highest quantity.
I've been playing with max(qty) and fetch first row only from examples I
found on the web but can't get exactly what I want.
Thanks
--
Art Tostaine
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit:
https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at
https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxx for any subscription related questions.
Help support midrange.com by shopping at amazon.com with our affiliate link:
http://amzn.to/2dEadiD
As an Amazon Associate we earn from qualifying purchases.