PostgreSQL BITWISE SHIFT LEFT
From w3cyberlearnings
Contents |
Postgresql << operator
The bitwise shift left operator.
Syntax << operator
a<<b
Example 1
postgres=# SELECT 14<<2; ?column? ---------- 56 (1 row) // 14=1110 // 56=111000
Example 2
postgres=# SELECT 3<<2; ?column? ---------- 12 (1 row)
Example 3
postgres=# SELECT 3<<12; ?column? ---------- 12288 (1 row)
Example 4
postgres=# SELECT 4<<1; ?column? ---------- 8 (1 row)
Related Links
- bitwise XOR(#)
- bitwise NOT(~)
- bitwise shift left(<<)
- bitwise shift right(>>)