课程: Programming Foundations: Databases
今天就学习课程吧!
今天就开通帐号,24,600 门业界名师课程任您挑!
Narrowing query results
- [Instructor] Using SELECT we can ask for specific rows in our table. But when we use it without qualification we get those fields for all the records in the table. To further refine our SELECT query we can use the WHERE clause to choose only specific records or records which match our criteria. I'll write a query here to get my customer's FirstName, LastName, and state from the customer's table. I'll run it and I'll see that we have a lot of results. Here after the FROM clause, I'll add a WHERE clause to filter these results. We'll take a look at customers only from the state of California. I'll run the query and here they are. I can use some logical operators in my query as well if I want to get results that match more than one condition. Let's take a look at the customers who are from California or Colorado. To do that after WHERE State="CA" I'll add OR State="CO". I'll run this query and then I can see that I have…