This function is used to return the sample variance of a specified column.
var_samp(col)
Parameter |
Mandatory |
Description |
---|---|---|
col |
Yes |
Columns with a data type of numeric. If the values are of any other type, NULL is returned. |
The return value is of the DOUBLE type.
select var_samp(items) from warehouse;
The command output is as follows:
_c0 294.342355
select warehourseId, var_samp(items) from warehourse group by warehourseId;
The command output is as follows:
warehouseId _c1 city1 18.23124 city2 16.23344 city3 11.43425