How to make mysql select pick up data with a list restriction?

Asked

Viewed 60 times

0

Good afternoon guys, in mysql select has the option IN(), which passes a string list, then it filters that list in select in Where, ex :

SELECT * FROM tabela WHERE id IN (1,2,3,4)

Is there a function that does this but the other way around? A != from the list? I searched the net and found nothing.

Thank you in advance.

1 answer

1


Faillen, use the modifier NOT before the IN, since way:

SELECT * FROM tabela WHERE id NOT IN (1,2,3,4)
  • Hmm, the site I found did not mention this rs, thank you very much gave it right, thank you very much

Browser other questions tagged

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