MSDN Documentation

SQL Operators

Operator Category Syntax Description
= Comparison expression1 = expression2 Tests equality of two expressions.
<> Comparison expression1 <> expression2 Tests inequality of two expressions.
> Comparison expression1 > expression2 Tests whether left expression is greater than right.
< Comparison expression1 < expression2 Tests whether left expression is less than right.
AND Logical condition1 AND condition2 Returns true if both conditions are true.
OR Logical condition1 OR condition2 Returns true if either condition is true.
NOT Logical NOT condition Negates a Boolean expression.
IN Set value IN (value1, value2, ...) Tests whether a value matches any value in a list.
BETWEEN Range value BETWEEN low AND high Tests whether a value lies within a range.
LIKE Pattern expression LIKE pattern Matches a pattern using wildcard characters.
+ Arithmetic expression1 + expression2 Adds two numeric expressions.
- Arithmetic expression1 - expression2 Subtracts the second numeric expression from the first.
* Arithmetic expression1 * expression2 Multiplies two numeric expressions.
/ Arithmetic expression1 / expression2 Divides the first numeric expression by the second.
% Arithmetic expression1 % expression2 Returns the remainder of division of the first expression by the second.
IS NULL Nullability expression IS NULL Tests whether an expression is NULL.
IS NOT NULL Nullability expression IS NOT NULL Tests whether an expression is not NULL.