
Josh R. answered 01/22/21
Analytics Manager that Spends All Day in SQL
'NOT IN' is an operator that will keep any rows where the value of a given field is not in a given list of values. Put another way, it will filter out any rows where the value of a given field is in a given list of values. For example, if I have a table of customers that includes their names, emails, and activation_dates, I could select all customer email addresses by writing:
If I want to only select emails from customers whose names are either "Jim", "James", or "Josh", I can write:
If I want to only select customers whose names are NOT "Jim", "James", or "Josh", I can write:
This is effectively the same as writing: