As you might remember, you can use the != statement to filter out values that are not equal to the condition, but as with = this will only work for exact values.

So, if you want to filter out based on values that are not exact, you should use the NOT statement instead.

Using the product list to create a list of all products in the webshop_order_line table except the ones where Cheese is included could be queried like this:

1select
2    *
3from
4    {{raw.e_commerce_sample.webshop_order_line}}
5where
6    product not like '%Cheese%'

Exercise 5: Find all the customers with First Names not starting with ‘S’

This exercise also uses the webshop_customer table.

This time try to write a query that does the opposite of last time:

find all the customers with first names starting with everything other than S.

If you run your query, it should give a result like this:

Exercise result

Another simple way to solve the exercise above would be to write a query like this:

1select
2    *
3from
4    {{raw.e_commerce_sample.webshop_customer}}
5where
6    first_name not like 'S%'

Next up

Introduction to columns

In this section of the tutorial, you’ll work with something new: creating new content to be included in your table.

Go to lesson