× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



You really need to share your code and explain "can't get exactly what I want".

Off the top of my head:

select CLASS, max(QUANTITY)
from MY_TABLE
group by CLASS



HTH

-----Original Message-----
From: Art Tostaine, Jr. [mailto:atostaine@xxxxxxxxx]
Sent: Tuesday, May 29, 2018 7:30 PM
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
Subject: 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


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.