2

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.

1 Answer 1

4

Just use NOT IN:

SELECT * 
FROM oc_product_to_category 
WHERE product_id  NOT IN  (28, 29, 30, 40)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.