0

I know WHERE, LIKE, IN filters in database. But how can I filter with "except" ? I want to select all data except a specificdata. Thanks in advance

5 Answers 5

5

with NOT IN, usage is like IN

SELECT * FROM USERS WHERE ID NOT IN (1,2,3,4,5)
Sign up to request clarification or add additional context in comments.

Comments

2

Three approaches:

WHERE column <> 'something' 
WHERE column NOT LIKE 'something' 
WHERE column not in('something')

Comments

1

you can use NOT IN

Comments

1

Note that you can use another query for NOT IN like this:

SELECT id FROM customers WHERE id NOT IN (SELECT id FROM bad_customers)

1 Comment

Can I insert the values of an array in IN(values of an array)?
0

WHERE NOT LIKE

WHERE NOT IN

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.