AS_REAL

functionsupportedCore SQL functions

docs.snowflake.com ↗

Semi-structured and structured data functions

Casts a VARIANT value to a floating-point value. AS_DOUBLE is a synonym for AS_REAL. The DOUBLE and REAL data types are synonymous with the FLOAT data type.

Syntax

AS_DOUBLE( <variant_expr> )

AS_REAL( <variant_expr> )

Parameters

NameRequiredDescription
variant_exprrequiredAn expression that evaluates to a value of type VARIANT.

Returns

The function returns a floating-point value or NULL: - If the type of the value in the variant_expr argument is a floating-point value, the function returns the floating-point value. - If the type of the value in the variant_expr argument doesn’t match the type of the output value, the function returns NULL. - If the variant_expr argument is NULL, the function returns NULL.

See also