From the course: SQL for Non-Programmers

Unlock the full course today

Join today to access over 23,100 courses taught by industry experts.

Filtering your data with multiple conditions

Filtering your data with multiple conditions - SQL Tutorial

From the course: SQL for Non-Programmers

Filtering your data with multiple conditions

We have learned to filter our data with a single condition. But oftentimes, we will want to include more than one condition. Expanding from a single condition to multiple conditions in your WHERE clause is easy. Within the same WHERE clause, which is always placed after the FROM clause, we can include as many filter conditions as we need. After your first filter condition, you can add the word AND plus the additional filter condition. You can repeat this process as many times as needed depending on the filters you need to apply. Let's see what this looks like in SLS. Expanding on our previous query, we can include multiple conditions in our WHERE clause. Let's say that in addition to understanding top orders in the bath products category, management asks us to provide bath product sales reports for a few employees in particular, starting with Clement Carry. We can add an additional filter using an AND operator. So right after the FROM clause we will add WHERE product category equals…

Contents