× 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.



Michael Ryan wrote:
I can't seem to get this right. Given data that looks like this:

5,769,550 247746
6,025,776 247746
6,025,777 247746
6,025,778 247746
6,004,452 257503
6,004,457 257503
5,986,723 279287
5,986,724 279287
5,986,725 279287
5,986,042 279369
5,986,049 279369
5,986,052 279369

How can I get the record with the largest first value in SQL? I want this:

6,025,778 247746
6,004,457 257503
5,986,725 279287
5,986,052 279369

Thanks!
If the first column is FIELD1 and the second column is FIELD2:

SELECT MAX(FIELD1), FIELD2 from TABLE group by FIELD2

Joe

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.