Skip to main content
Scalar function
In Databricks context NULL arguments are ignored unless all arguments are NULL. In the Snowflake-style/default context, any NULL argument yields NULL.

Syntax

Scalar

Arguments

Returns

  • Type: The common comparison type after converting the arguments; explicit same-type arguments preserve that SQL type
  • Possible values: One of the argument values after applicable type conversion, or NULL.
  • NULL behavior: In Databricks context NULL arguments are ignored unless all arguments are NULL. In the Snowflake-style/default context, any NULL argument yields NULL.

Properties

Usage notes

  • INTEGER and INT mean the same type; STRING means VARCHAR text. NULL can be used with a supported type. Cast NULL explicitly when its type would otherwise be unclear.
  • Query tools may report a DECIMAL result as DOUBLE or a TIME result as INTEGER. The returned value still keeps its decimal precision and scale, or its time type. A reported type does not convert the value.
  • Deterministic: The same inputs and settings produce the same result.

Examples

Typical behavior

Compare dates

Last modified on October 15, 2026