codingtcher.com
Theme Night
Home
Login

sql sum multiple columns

Home » Tutorial Post » sql sum multiple columns

sql add two values together

SELECT  ID, SUM(VALUE1 + VALUE2)
FROM    tableName
GROUP   BY ID

--or simple addition

SELECT
	ID,
	(VALUE1 + VALUE2) as AddedValues
FROM tableName
Source: stackoverflow.com

SQL Add Multiple Columns in a Table

ALTER TABLE Customers
ADD phone varchar(10), age int;

Related Post