Skip to main content
Scalar function
Returns NULL when an argument is NULL.

Syntax

Scalar

Arguments

Returns

  • Type: INT
  • Possible values: An integer from 0 through 64.
  • NULL behavior: Returns NULL when an argument is NULL.

Properties

Usage notes

  • Signed inputs are sign-extended to 64 bits before counting; negative TINYINT, SMALLINT and INT operands therefore count the 64-bit representation.
  • Use the numeric input types listed above. BOOLEAN is not a supported SQL input.

Examples

Set bits and signed representation

Zero and positive integers

Last modified on October 15, 2026