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
SUM()
This does just one sum() query, so it should perform OK:
sum()
SELECT a.id, b.amount FROM table1 a cross join (SELECT SUM(amount) as amount FROM table1 AS amount) b