I have the following problem I am trying to solve:
I have one table with data and need to access the same column twice, everyone with different criteria and then output the results on one table.
SELECT e.user, SUM(e.column), SUM(f.column) FROM table AS e INNER JOIN table AS f ON e.user = f.user WHERE (e.criterion1 and f.criterion2) GROUP BY e.user
sums are calculated multiple times. What is wrong?
Thank you very much in advance.