Per aggiungere campi (colonne):
SELECT col1, col2, col3, (col1+col2+col3) AS Total FROM table;
Per sommare le righe, usa SUM()
aggregato:
SELECT
userid,
SUM(col1) AS col1_total,
SUM(col2) AS col2_total
FROM table
GROUP BY userid
Per aggiungere campi (colonne):
SELECT col1, col2, col3, (col1+col2+col3) AS Total FROM table;
Per sommare le righe, usa SUM()
aggregato:
SELECT
userid,
SUM(col1) AS col1_total,
SUM(col2) AS col2_total
FROM table
GROUP BY userid