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



Thanks Joe...I was sure I had that variation before...maybe I didn't
GROUP it. Thanks for the help!

On Wed, Jun 25, 2008 at 12:22 PM, Joe Pluta <joepluta@xxxxxxxxxxxxxxxxx> wrote:
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
--
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: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.