I am trying to sum two columns of the same table row by row but my code gives me the total of the two tables.
id Price 1 price 2
1 20 20
2 40 30
Select sum( price1+price2) from table
SELECT (price1+price2) as total_price FROM table
SUM is an aggregation function : it aggregates all records found and does the sum.
price1 + price2 sums this two columns for each record separatly.