O'Reilly logo

Microsoft Azure SQL Data Warehouse - Architecture and SQL by Todd Wilson, Tom Coffing

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 22 – Statistical Aggregate Functions

"You can make more friends in two months by becoming interested in other people than you will in two years by trying to get other people interested in you."

- Dale Carnegie

The Stats Table

image

Above, is the Stats_Table data in which we will use in our statistical examples.

The VAR and VARP Functions

SELECT VAR(col1)   AS Variance_Example,

 VARP(col1) AS Var_EntirePopulation

FROM   Stats_Table ;

Variance_Example Var_EntirePopulation
77.5      74.92     

The VAR and VARP functions return the statistical variance of all the values in the specified expression. The VAR uses a sample of the data population ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required