Aller au contenu principal

bin function

Applies to: check marked yes Databricks SQL check marked yes Databricks Runtime

Returns the binary representation of expr.

Syntax​

bin(expr)

Arguments​

  • expr: A BIGINT expression.

Returns​

A STRING.

Examples​

SQL
> SELECT bin(13);
1101
> SELECT bin(-13);
1111111111111111111111111111111111111111111111111111111111110011
> SELECT bin(13.3);
1101