Hey there,
I must have a single select execute 2 sums, from two different tables.
For example:
SELECT
tbl1.ID as ID,
SUM(tbl1.value1) AS Money_Earned,
SUM(tbl2.value2) AS Money_Spent
FROM
income tbl1, expenses tbl2
WHERE
tbl1.ID = tbl2.ID
GROUP BY
tbl1.ID
I get a table back in the form I expect, but instead of a sum, I'm getting a product of the number of entries in the table that meet the criteria * the sum of those values.
Please help! What am I doing wrong?
Thankz.
-- This message may have been cut off and the rest will only be shown to members. To become a member, click here --