Something like the following should get you started select p.player, sum(goals) from player p left outer join scores s on p.player = s.player group by p.player having s.gamedate between date1 and date2 order by sum(goals) desc
Chris. On Oct 21, 3:50 pm, BazD <[EMAIL PROTECTED]> wrote: > Hi folks > > Im hoping someone can help me on a little cfmx + sql query... > > I have a sql database, one table contains a list of soccer players > (playerID, firstname, surname, title etc) and a 2nd table containing a > score sheet (playerID, date, goals etc) > > What Im trying to do is display the information based on date > selection. > > ie. Loop through all the players names and list a total of all the > goals each player has scored between 1st September 2008 and 20th > October 2008 > > so the output would be something like this: > > Bobby Charlton 30 > Ossi Ardilles 25 > David Beckham 01 (Im generous!) > > Total 56 > > Any ideas much appreciated > > Ta > B --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "farcry-dev" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/farcry-dev?hl=en -~----------~----~----~----~------~----~------~--~---
