Lưu ý
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử đăng nhập hoặc thay đổi thư mục.
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử thay đổi thư mục.
Applies to:
Databricks SQL
Databricks Runtime
Returns the sample variance calculated from values of a group. This function is a synonym for variance aggregate function.
Syntax
var_samp ( [ALL | DISTINCT] expr ) [FILTER ( WHERE cond ) ]
This function can also be invoked as a window function using the OVER clause.
Arguments
expr: An expression that evaluates to a numeric.cond: An optional boolean expression filtering the rows used for aggregation.
Returns
A DOUBLE.
If DISTINCT is specified the function operates only on a unique set of expr values.
Examples
> SELECT var_samp(col) FROM VALUES (1), (2), (3), (3) AS tab(col);
0.9166666666666666
> SELECT var_samp(DISTINCT col) FROM VALUES (1), (2), (3), (3) AS tab(col);
1.0