OR Operator Table
A |
B |
A OR B |
---|---|---|
True |
True |
True |
True |
False |
True |
False |
True |
True |
Explanation: In this table, we are performing an operation with an OR Operator on two conditions A and B. You will get the False as a result, when both conditions A and B are wrong. You will get True when one of two conditions is True.
Syntax:
Explanation: condition1 and condition2 are conditions that return boolean values on evaluation.
The precedence order of the logical operators is as follows NOT > AND > OR where there are no parenthesis.
SQL Server OR Operator
Logical operators are used for combining multiple boolean expressions which are a combination of results of multiple conditions which are formed by the comparators. Some of the logical operators are AND, OR, EXISTS, IN, LIKE, BETWEEN, etc, Logical operators are very frequently used and are very handy for testing multiple conditions. The logical operator OR is used for combining multiple boolean expressions and it returns true only when any one of the conditions is true. It is used primarily with WHERE, CASE, and HAVING clauses by specifying multiple boolean expressions that return any one of the following values True, or False.
Contact Us