March 2001
Intermediate to advanced
640 pages
14h 9m
English
You will often need to combine conditions in the WHERE clause to find rows that meet multiple criteria. For example, you might want to see the price of several products, as in this query:
select ProductName, UnitPrice
from Products
where ProductName = 'Konbu'
or ProductName = 'Cream Cheese'
or ProductName = 'Tofu'
or ProductName = 'Pavlova'
Results:
ProductName UnitPrice ---------------------------------------- --------------------- Konbu 6.0000 Pavlova 17.4500 Tofu 23.2500
The four comparisons in the query are joined with the keyword OR. As in all programming environments, when you use OR, the condition is true when any of the joined conditions is true. For each row, the server tests each of the conditions. ...
Read now
Unlock full access