From the course: SQL Essential Training

Unlock the full course today

Join today to access over 22,700 courses taught by industry experts or purchase this course individually.

Brackets and order

Brackets and order - SQL Tutorial

From the course: SQL Essential Training

Start my 1-month free trial

Brackets and order

- [Instructor] Now the management has tasked us with a new request and they would like us to get a list of all invoices that are greater than $1.98 from any cities whose names start with P or D. Now, if we recall from our last query, which we still have here, we've satisfied the criteria for cities that start with P or cities that start with D. The one twist in the current request is to have all invoices that are greater than $1.98. So let's respond to this request by altering our WHERE clause, and saying: total greater than $1.98. In addition to this, you want to include the AND operator and say the complete WHERE clause criteria, which is now saying: total is greater than $1.98 AND BillingCity LIKE P OR BillingCity LIKE D. Now let's run our current statement and observe the result. We've gone to 43 rows, and let's take a look. If we really pay attention to our results here, we might find that we have some…

Contents