From the course: Introduction to SQL Using Google BigQuery

Unlock this course with a free trial

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

WHERE clause BETWEEN and IN

WHERE clause BETWEEN and IN

- [Instructor] Sometimes we will want to apply WHERE clauses, not just for equality conditions, but we might want to look for ranges of data that meet a wider set of conditions. This is where we can use inequalities and the BETWEEN and IN operators to help. Let's firstly apply a WHERE clause to return product information for all products with retail price strictly under $6. We can use this less than sign or the left angle bracket to apply this logical condition. If we also wanted to add in products which are exactly $6 to our WHERE clause, we can add in an extra equal sign after the less than to apply less than or equal to logic for our query. To perform this style of inequality but in the opposite direction, we can use the greater than sign or the right angle bracket to apply this in our WHERE clause. In this example, we can find all items strictly greater than $55 with this logic. Again, if we wanted to include the…

Contents