PostgreSQL BITWISE XOR
From w3cyberlearnings
Contents |
Postgresql XoR operator
The bitwise XOR operator.
Syntax XOR operator
a # b
Example 1
postgres=# SELECT 9#3 as xor1; xor1 ------ 10 (1 row) // binary XOR 9=1001 3=0011 =1010
Example 2
postgres=# SELECT 12#3 as xor1; xor1 ------ 15 (1 row)
Example 3
postgres=# SELECT 2#5 as xor1; xor1 ------ 7 (1 row)
Related Links
- bitwise XOR(#)
- bitwise NOT(~)
- bitwise shift left(<<)
- bitwise shift right(>>)