🖌️Operators
Arithmetic Operators
Arithmetic operators perform mathematical calculations between numeric columns or expressions.
+
(Addition) - Adds two values together.
-
(Subtraction) - Subtracts one value from another.
*
(Multiplication) - Multiplies two values.
/
(Division) - Divides one value by another.
%
(Modulo) - Returns the remainder after division.
Bitwise Operators
Bitwise operators perform binary logic between numeric values at the individual bit level.
&
(Bitwise AND) - Compares bits and returns 1 only if both bits are 1.|
(Bitwise OR) - Compares bits and returns 1 if either bit is 1.^
(Bitwise XOR) - Compares bits and returns 1 if the bits are different.
Comparison Operators
Comparison operators test for logical conditions between expressions.
=
(Equal) - Checks for equality between two values.>
(Greater than) - Checks if left value is greater than right value.<
(Less than) - Checks if left value is less than right value.>=
(Greater than or equal to) - Checks for greater or equal condition.<=
(Less than or equal to) - Checks for less than or equal condition.<>
or!=
(Not equal to) - Checks for inequality between two values.
Compound Assignment Operators
Compound operators provide shorthand for performing an operation and assignment.
+=
(Add equals) - Add and assign e.g.x += 5
(x = x + 5)-=
(Subtract equals)*=
(Multiply equals)/=
(Divide equals)%=
(Modulo equals)
Logical Operators
Logical operators test for complex logical conditions involving multiple operators.
ALL
- TRUE if all subquery values meet a condition.AND
- TRUE if all conditions are TRUE.ANY
- TRUE if any subquery values meet a condition.BETWEEN
- TRUE if within a range.EXISTS
- TRUE if subquery returns rows.IN
- TRUE if equal to value in list.LIKE
- TRUE if matches a pattern.NOT
- Inverts a condition's meaning.OR
- TRUE if any condition is TRUE.SOME
- TRUE if any subquery values meet a condition.
Last updated