Database Reference
In-Depth Information
Range Operator
BETWEEN is SQL Server's range operator; it allows you to specify the range of data you want to base your
condition upon. For example, you want to provide the range of data you would like to see. SQL Server
offers its negation as well, NOT Between , so you can choose the values that you don't want to be included
in your result set.
Try It: Using the BETWEEN Operator
Open a New Query window in SQL Server Management Studio. Enter the following query, and click
Execute. You should see the results shown in Figure 5-17.
select AddressID, AddressLine1, City
from Person.Address
where AddressID between 201 and 300
Figure 5-17. Using the Between operator
 
Search WWH ::




Custom Search