I have a problem with an SQL query.
SELECT SUM(table_colum) AS value, SUM(value * 3) AS value2 FROM table;
You need to know this is a short representation of my whole query.
The error:
Unknown column 'value' in 'field list'
Is there a way to reuse value in another SUM()?
You can just do:
Internally, the server will only do the
SUM(table_colum)calculation once and use the result twice.