~ (tilde sign) operator (Databricks SQL)

Returns the bitwise NOT of expr.

Syntax

~ expr

Arguments

  • expr: An integral numeric type expression.

Returns

The result type matches the type of expr.

Examples

> SELECT ~ 0;
 -1