I already read (this), but couldn\'t figure out a way to implement it to my specific problem. I know SUM() is an aggregate function and it doesn\'t make sense n
SELECT a.id, b.amount
FROM table1 a
CROSS JOIN
(
SELECT SUM(amount) amount FROM table1
) b
You need to perform a cartesian join of the value of the sum of every row in the table to each id. Since there is only one result of the subselect (49), it basically just gets tacked onto each id.