Let's say that I want to retrieve rows from just one table and exclude rows with certain ID's.
Hypothetical table:
+----+-------+------+
| id | value | type |
+----+-------+------+
| 1 | foo | cool |
+----+-------+------+
| 2 | bar | cool |
+----+-------+------+
| 3 | lor | cool |
+----+-------+------+
| 4 | ips | cool |
+----+-------+------+
| 5 | asd | cool |
+----+-------+------+
| 6 | qwe | warm |
+----+-------+------+
The rows I want is the rows that are of the type "cool" and id not equal to 2, 3 and 5. How would I write this?
My guess so far has been something like this, but it doesn't work:
SELECT * FROM table WHERE type='cool' AND id != 2,3,5
How can I achieve what I want in the most efficient way?
All replies are greatly appreciated!
Thank you!