Mysql join and sum is doubling result
问题 I have a table of revenue as title_id revenue cost 1 10 5 2 10 5 3 10 5 4 10 5 1 20 6 2 20 6 3 20 6 4 20 6 when i execute this query SELECT SUM(revenue),SUM(cost) FROM revenue GROUP BY revenue.title_id it produces result title_id revenue cost 1 30 11 2 30 11 3 30 11 4 30 11 which is ok, now i want to combine sum result with another table which has structure like this title_id interest 1 10 2 10 3 10 4 10 1 20 2 20 3 20 4 20 when i execute join with aggregate function like this SELECT SUM