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.
|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 ...