I don't think this can be done in a single query, but what about:
SELECT Reference.id1, Reference.id2, sum(Table1.number)
FROM Table1, Reference
WHERE Reference.id1=Table1.id1
GROUP BY Reference.id1
Which gives you:
+--+--++
| id1 | id2 | sum(Table1.number) |
Hi,
I have one table with an id1 column and a number column, these numbers
correspond to another table with an id2 column and a name column and a total
column. I also have a reference table with ties the two together (an id1 and
id2 column).
I want to be able to select all numbers in the first