Pages

Wednesday, January 19, 2011

Average & Sum

AVG & SUM
--==========================================[AVG]===========================================================================
--AVG aggregate function selects the average value for certain table column.

--Avg---------
SELECT AVG(EmailPromotion) AS AvgEmailPromotion
FROM Person.Contact

--==========================================[SUM]===========================================================================
--SUM aggregate function allows selecting the total for a numeric column.

---Sum--------
SELECT SUM(EmailPromotion)
FROM Person.Contact

No comments:

Post a Comment