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