August 2012
Intermediate to advanced
1416 pages
33h 39m
English
The WHERE conditions filter the output of the FROM clause and restrict the returned rows in the result set. The conditions can refer to the data within the tables, expressions, built-in SQL Server scalar functions, other queries, or user-defined functions. The WHERE conditions can also use several possible comparison operators and wildcards, as listed in Table 6.1. In addition, you can combine multiple WHERE conditions using Boolean AND, OR, and NOT operators.
Table 6.1 Standard Comparison Operators
| Description | Operator | Example |
| Equals | = | Quantity = 12 |
| Greater than | > | Quantity > 12 |
| Greater than or equal to | >= | Quantity >= 12 |
| Less than | < | Quantity < 12 |
| Less than or equal to | <= | Quantity<= 12 |
| Not equal to | <> , != | Quantity <> 12 , Quantity != 12 |
| Not less than | !< | Quantity !< 12 |
| Not greater than | !> | Quantity !> 12 |
In addition to the standard comparison operators, which are no doubt familiar, SQL provides four special comparison operators: BETWEEN, IN, LIKE, and IS. The first three are explained in this section. Testing ...
Read now
Unlock full access