Database Reference
In-Depth Information
Figure 5-11. Using the LIKE operator with [^]
How It Works
You specify three columns of the Address table.
select AddressID, AddressLine1, City
from Person.Address
You specify the WHERE clause with a pattern using the LIKE operator to list all cities that do not begin
with the letter B or R or S and consist of any number of letters after that; for example, Bellevue,
Redmond, Seattle, and so on, are not going to be included in the result set.
where City like '[^B,R,S]%'
Order by City Asc
Aggregate Functions
SQL has several built-in functions that aggregate the values of a column. Aggregate functions are applied
on sets of rows and return a single value. For example, you can use aggregate functions to calculate the
average unit price of orders placed. You can find the order with the lowest price or the most expensive.
MIN , MAX , SUM , AVG , and COUNT are frequently used in aggregate functions.
 
Search WWH ::




Custom Search