int function (Databricks SQL)

Casts the value expr to INTEGER.

Syntax

int(expr)

Arguments

  • expr: Any expression which is castable to INTEGER.

Returns

An INTEGER.

This function is a synonym for CAST(expr AS INTEGER).

Examples

> SELECT int(-5.6);
 5
> SELECT int('5');
 5