Yesterday I wrote article about SQL SERVER - Introduction to Aggregate Functions. I received one email that four of the aggregate functions are statistical function and I should write something about that. VAR, STDEVP, STDEV, VARP are statistical functions as well they absolutely fit in the definition of aggregate function as well. The usage of this function is pretty simple so instead of explaining them I will go to example right away.
USE AdventureWorks;
GO
SELECT VAR(Bonus) 'Variance',
STDEVP(Bonus) 'Standard Deviation',
STDEV(Bonus) 'Standard Deviation',
VARP(Bonus) 'Variance for the Population'
FROM Sales.SalesPerson;
GO
All the functions returns result as datatype float. VAR and VARP can only be applied to numeric well all other can be applied to all numeric data type except INT datatypes.
Reference : Pinal Dave (http://www.SQLAuthority.com)






Hi, Can You help me with my little questions?
I need to know if with a statistical funtion I can to know which tables are not used in a database.
Thanks
Milton
hi,
plz write something about:
what are statistics and what is the use of it? plz help
warm regards
Sandeep (noida)
Hi,
I want to summarize by the Mode on some categorical data.
I want to show the most common type of family structure (single parent, nuclear, extended etc) by village.
Any help please.
hi pinal,
i know about this function but my requirement is some what complicated
i have one table which include two thing one is district and the county now i want all county list not records group by district.
ex
District1
coun1, coun2, coun3
District2
coun1, coun2, coun3
So how can i do such thing
:) manish (: