Welcome Guest, Not a member yet? Register   Sign In
Query help with scores
#3

[eluser]Kevv[/eluser]
Something like this should do what you want;
Code:
SELECT s.member_id, COUNT(s.member_id) AS 'birdies' FROM scores s
JOIN holes h ON s.hole_id=h.hole_id AND s.gross_score+1=h.hole_par
WHERE h.hole_id=2 /* limit to specific hole */
GROUP BY s.member_id
ORDER BY COUNT(s.member_id) DESC
You'll probably want to add another join to get the member name too.


Messages In This Thread
Query help with scores - by El Forum - 04-29-2010, 05:07 AM
Query help with scores - by El Forum - 04-29-2010, 05:42 AM
Query help with scores - by El Forum - 04-29-2010, 06:33 AM
Query help with scores - by El Forum - 04-29-2010, 07:04 AM
Query help with scores - by El Forum - 04-29-2010, 08:00 AM
Query help with scores - by El Forum - 04-29-2010, 08:03 AM
Query help with scores - by El Forum - 04-29-2010, 01:00 PM
Query help with scores - by El Forum - 04-30-2010, 02:47 AM
Query help with scores - by El Forum - 04-30-2010, 03:07 AM



Theme © iAndrew 2016 - Forum software by © MyBB