The syntax of the WHERE clause with logical operators : Logical operator « Query « SQL Server / T-SQL Tutorial






WHERE [NOT] search_condition_1 {AND|OR} [NOT] search_condition_2 ...








1.26.Logical operator
1.26.1.The syntax of the WHERE clause with logical operators
1.26.2.A compound condition without parentheses
1.26.3.compound condition with parentheses
1.26.4.three Boolean operations have different priorities for evaluation:
1.26.5.SQL Server evaluates operators in this sequence: (1) NOT, (2) AND, and (3) OR.
1.26.6.Use OR to link two conditions
1.26.7.Use AND to link two conditions
1.26.8.AND, OR without parenthesis
1.26.9.parenthesis with AND, OR
1.26.10.And with parenthesis
1.26.11.Not or