From the course: Complete Guide to Analytics Engineering

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Filtering data results with the WHERE clause

Filtering data results with the WHERE clause

From the course: Complete Guide to Analytics Engineering

Filtering data results with the WHERE clause

- [Narrator] Our imaginary stakeholder at Red30 Tech needs us to provide all of the sales that occurred for the following employee numbers, in both separate lists and also in one list. I've provided those employee IDs here marked in green. We can accomplish this by implementing a where clause in our select statement. Where clauses go directly after the from clause in the select statement. I'm going to remove the limit on this query and change the order by from order by total to order by date. I'm also going to add the employee ID columns so that we confirm that these sales are just for that employee. Let's begin. First, we'll remove the limit. Next, we'll order by OrderDate instead of OrderTotal. Let's add our new field, EmpID. We'll move our OrderDate field down the line. Make sure to separate them with commas. And now let's add our where clause. Remember, where comes after the from, and it works just like you might imagine, where EmpID =. And let's grab this first one here and enter…

Contents