xor
Bitwise XOR.
Try an expression
In Formula, enter the expression and set Output type to INTEGER.
Expression
xor(17, 5)Result
20To use your own data, replace the example values with column names. Keep format strings and other options as written.
Arguments and types
xor(left, right)- left
- Number, Bits
- right
- Number, Bits
Supported signatures (11)
xor(left: BIGINT, right: BIGINT) → BIGINT
xor(left: BIT, right: BIT) → BIT
xor(left: HUGEINT, right: HUGEINT) → HUGEINT
xor(left: INTEGER, right: INTEGER) → INTEGER
xor(left: SMALLINT, right: SMALLINT) → SMALLINT
xor(left: TINYINT, right: TINYINT) → TINYINT
xor(left: UBIGINT, right: UBIGINT) → UBIGINT
xor(left: UHUGEINT, right: UHUGEINT) → UHUGEINT
xor(left: UINTEGER, right: UINTEGER) → UINTEGER
xor(left: USMALLINT, right: USMALLINT) → USMALLINT
xor(left: UTINYINT, right: UTINYINT) → UTINYINTThe result type can depend on the input types. See DuckDB for the full argument rules.
Things to know
If the first argument is missing, the result is NULL.
Function metadata from DuckDB, used under the MIT license.