September 2007
Intermediate to advanced
600 pages
20h 21m
English
Multiple WHERE clauses can be evaluated as AND conditions or OR conditions. The example in Listing 6.8 is an AND condition. Only rows in which both the last name is Forta and the first name is Ben will be retrieved. If you change the clause to the following, contacts with a first name of Ben will be retrieved (regardless of last name) and contacts with a last name of Forta will be retrieved (regardless of first name):
WHERE FirstName='Ben' OR LastName='Forta'
You can combine the AND and OR operators to create any search condition you need. Listing 6.9 shows a WHERE clause that can be used to retrieve only Ben Forta and Rick Richards.
SELECT NameFirst, NameLast, ... |
Read now
Unlock full access