PostgreSQL - Operators
An operator is a reserved word or a character used primarily in a PostgreSQL statement's WHERE clause to perform operation(s), such as comparisons and arithmetic operations.
Operators are used to specify conditions in a PostgreSQL statement and to serve as conjunctions for multiple conditions in a statement.
- Arithmetic operators
- Comparison operators
- Logical operators
- Bitwise operators
Assume variable a holds 2 and variable b holds 3, then −
ExampleBitwise operator works on bits and performs bit-by-bit operation. The truth table for & and | is as follows −
Assume if A = 60; and B = 13; now in binary format they will be as follows −
A = 0011 1100
B = 0000 1101
-----------------
A&B = 0000 1100
A|B = 0011 1101
~A = 1100 0011
The Bitwise operators supported by PostgreSQL are listed in the following table −
Comments
Post a Comment