Jump to content

MAX () Problem in query


Wykster

Recommended Posts

Hi,

 

Please bear with me as I am learning this stuff.  I have a query that gives

me the top 5 players of a dart team by their maximum average.  When I run

it, I get the top 5 averages but they are all distinct players names.  I

know for a fact that in the top 5 averages the same player is in positions

1, 2, and 3.  Here is the query that I have built, I aplogise but could

somebody advise me on how to change the query to give me the top 5

regardless of the same player appearing in the top 5.

 

$max_average_mb_sql = mysql_query("SELECT MAX(match_records.ave) AS mbave,

players.playerID,

players.playerName, players.surname

FROM match_records, players

WHERE match_records.playerID = players.playerID

AND match_records.seasonID = $season_seasonid

AND match_records.MorF = 'M'

AND match_records.AorB = 'B'

AND match_records.W_L = 'W'

GROUP BY players.playerName, players.surname

ORDER BY mbave DESC

LIMIT 0 , 5");

 

Regards

Dave

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.