The VAR() return the measure of how far the extreme low range or high range value is from the middle : VAR « Analytical Functions « SQL Server / T-SQL Tutorial






or mean value of the range, weighted by the greatest concentration of similar values.

11>
12> Create Table MyValues (MyValue Float)
13> GO
1>
2> Insert Into MyValues (MyValue) SELECT 2
3> Insert Into MyValues (MyValue) SELECT 3
4> Insert Into MyValues (MyValue) SELECT 4
5> Insert Into MyValues (MyValue) SELECT 5
6> Insert Into MyValues (MyValue) SELECT 6
7> GO

(1 rows affected)

(1 rows affected)

(1 rows affected)

(1 rows affected)

(1 rows affected)
1>
2> SELECT VAR(MyValue) FROM MyValues
3> GO

------------------------
                     2.5

(1 rows affected)
1>
2> INSERT INTO MyValues (MyValue) SELECT 3
3> INSERT INTO MyValues (MyValue) SELECT 4
4> INSERT INTO MyValues (MyValue) SELECT 4
5> INSERT INTO MyValues (MyValue) SELECT 4
6> INSERT INTO MyValues (MyValue) SELECT 5
7> GO

(1 rows affected)

(1 rows affected)

(1 rows affected)

(1 rows affected)

(1 rows affected)
1>
2> SELECT VAR(MyValue) FROM MyValues
3> GO

------------------------
      1.3333333333333333

(1 rows affected)
1>
2>
3> drop table MyValues;
4> GO








14.12.VAR
14.12.1.VAR computes the variance of all the values listed in a column or expression.
14.12.2.The VAR() return the measure of how far the extreme low range or high range value is from the middle