Reputation: 3531
I want to select all ids except specific which like 28, 29, 30, 40
. I tried following query.
SELECT * FROM oc_product_to_category WHERE product_id !IN (28, 29, 30, 40)
I searched about it and find this. but it expr IN (28, 29, 30, 40)
does not working. Can any is this possible with sql function? I would like to appreciate.
Upvotes: 2
Views: 466
Reputation: 72165
Just use NOT IN
:
SELECT *
FROM oc_product_to_category
WHERE product_id NOT IN (28, 29, 30, 40)
Upvotes: 4