SELECT d.dnumber AS RUN, SUM(p.points) AS Points FROM dogs d JOIN points p ON p.dog = d.dnumber GROUP BY d.dnumberThis returns a list of RUNs with associated Points, but it only recognizes RUNs that exist in both the dogs and points tables. I need all dogs in the dogs table regardless is they exist in the points table. If they don't exist in the points table I am expecting a null or 0 for the Points result for that RUN.
Another Query Quandry
Posted 09 May 2006 - 01:40 PM
Posted 09 May 2006 - 11:22 PM
SELECT d.dnumber AS RUN, SUM(p.points) AS Points FROM dogs d LEFT JOIN points p ON p.dog = d.dnumber GROUP BY d.dnumber
Donations gratefully received
|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts
Posted 10 May 2006 - 02:05 AM
Thank you, once again PHP Freaks saves the day!!!!
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users