Hi, Not sure how to explain this - but here is what I need. I have a hockey pool database with three tables - one has the players and their stats, one has the team owner, and the 3rd is the reference file that ties the two together.
I want to be able to do a query for all the players on a particular team that are forwards and get a grand total of all their points. I already have a query that does something similar, but it just displays the individual players stats. Example: Team 1 Player Position Goals Points *Bob Bonk F 22 50 Hossa F 33 41 Total 55 91 This is what I want to achieve - and then the same for the rest of the teams. *This is my query that get the individual players points. $query = "select team.name, player, position, gp, goals, ppg, gwg, shg, ass, pm, shots, pim, points from roster join reference join team where team.idn=reference.idn and reference.idp=roster.idp and team.idn = '$team' and position like '$position' order by points desc"; TIA --------------------------------------------------------------------- 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