Skip to main content
Version: 24.3.x

Categories: Aggregate, Window

VAR_SAMP

Returns the sample variance of non-NULL records.

Syntax

VAR_SAMP(numeric_expression int64) → double

  • numeric_expression: The set of records to calculate variance for.

Examples

VAR_SAMP example
SELECT VAR_SAMP(passenger_count) FROM Samples."samples.dremio.com"."NYC-taxi-trips"
-- 1.868747683518558

VAR_SAMP(numeric_expression float) → double

  • numeric_expression: The set of records to calculate variance for.

Examples

VAR_SAMP example
SELECT VAR_SAMP(tip_amount) FROM Samples."samples.dremio.com"."NYC-taxi-trips"
-- 5.106086065187043

VAR_SAMP(numeric_expression double) → double

  • numeric_expression: The set of records to calculate variance for.

Examples

VAR_SAMP example
SELECT VAR_SAMP(tip_amount) FROM Samples."samples.dremio.com"."NYC-taxi-trips"
-- 5.106086065187043

VAR_SAMP(numeric_expression int32) → double

  • numeric_expression: The set of records to calculate variance for.

Examples

VAR_SAMP example
SELECT VAR_SAMP(passenger_count) FROM Samples."samples.dremio.com"."NYC-taxi-trips"
-- 1.868747683518558

Usage Notes

For single input records, VAR_SAMP will return NULL.