SQL logical operators are used to test for the truth of the condition. A logical operator like the Comparison operator returns a boolean value of TRUE, FALSE, or UNKNOWN.
Given below is the list of logical operators available in SQL.
Operator Meaning
- AND TRUE if both Boolean expressions are TRUE.
- IN TRUE if the operand is equal to one of a list of expressions.
- NOT Reverses the value of any other Boolean operator.
- OR TRUE if either Boolean expression is TRUE.
- LIKE TRUE if the operand matches a pattern.
- BETWEEN TRUE if the operand is within a range.
- ALL TRUE if all of a set of comparisons are TRUE.
- ANY TRUE if any one of a set of comparisons is TRUE.
- EXISTS TRUE if a subquery contains any rows.
- SOME TRUE if some of a set of comparisons are TRUE.