Menu
I’m doing a sum within a SQL query.
That sum is coming from a column in a joined table. This table also has an ID field relating to another table.
I’m getting the SUM perfectly. But I also need to know what all the ID’s are.
I’ve got two options.
a) SELECT and order by this ID. When I loop through the results I accumulate the total as I go and put the ID into an array. At the end I have a grand total and array of ID’s I need.
b) is there a way to place these into a single column as an array?