Search code examples
mysqlwhere-clausewhere-in

MYSQL Not equal to "IN" query


I have a table with loads of id's but I don't want to select around 10 id's

First I tried multiple OR but that didn't work then found the IN

SELECT * FROM table WHERE id IN (10, 88, 99)

But this selects those numbers I want all the other numbers so a not equal to needs to go in somewhere


Solution

  • Try this:

     SELECT * FROM table WHERE id NOT IN (10, 88, 99)
    

    Hope this helps