How not to select lines with values from an informed list of values

Asked

Viewed 32 times

-1

Instead of using the logical operator of different !=, would like to use a code that performs the query disregarding a list of values as in In only that the reverse.

Select from teste where teste1 (código) ('x','y','a','g')

I’m using the != but I need to write many command lines to bring what I need, because there are several data that I do not need to be consulted.

1 answer

1

Use Not In

Select from Tabela where Coluna Not In ('x', 'y', 'a', 'g')

Browser other questions tagged

You are not signed in. Login or sign up in order to post.