views:

226

answers:

1

Is there a cleaner way to perform this query in MySQL?

SELECT * FROM table WHERE id != 1 AND id != 2 AND id != 7

like:

SELECT * FROM table WHERE id != (1,2,7)
+17  A: 
SELECT * FROM table WHERE id NOT IN (1,2,7)
Edo
Awesome, thank you. SQL is one of those things I don't use very often , I really ought to spend a day with a book and I'm sure I'll be blown away!
rpflo