Hi all,

I'm trying to figure out a way to select a group of maximums from a set
such that each value pair's greatest value is in the result set. For
example, let's say I have this table Value_Pairs:

Name | Value
------------
Bob    1
Joe    7
Bob    2
Don    3
Don    4
Bob    6

The result I want is like this:

Name | Value
------------
Bob    6        //Bob's highest value in the table
Joe    7        //Joe's highest value in the table
Don    4        //Don't highest value in the table

So I'm looking for distinct maximums.
Is it possible to do this *with a single query* in MySQL? I've tried a
number of things and nothing comes close.

ben


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to