Filter Results I: Use the Where Clause

In practice, you will always apply a filter to your queries. For example, let’s extend some of the previous examples by qualifying for a specific client type. If you recall, clients can either be business or individuals. The Client Type field indicates which type applies. To illustrate how the Where clause works, consider the following example that extracts the first- and lastname data for clients that are individuals:

SELECT  lastname + ", " + firstname As client
   From Client
   Where ClientType = "I"

A few additional modifications were made. Did you notice the first- and lastname positions were reversed and separated by a comma? With regard to how the Where clause works, that is fairly straightforward. ...

Get Absolute Beginner’s Guide to Databases now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.