Skip to main content
Converts a value (<expression>) of type INTEGER or BIGINT to its equivalent two’s complement binary representation.

Syntax

Parameters

Return Type

TEXT
  • Returns NULL if the input is NULL

Remarks

The function returns the binary representation of the input number as a text string. Negative numbers are represented using two’s complement notation. Leading zeros are omitted, but the output is at least one digit long.

Example

The following examples convert integer values to their binary representations:

Rows: 1Execution time: 6.08ms

Rows: 1Execution time: 5.58ms

Rows: 1Execution time: 5.09ms

Rows: 1Execution time: 5.74ms