Reputation: 5802
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
Upvotes: 0
Views: 150
Reputation: 3760
Three approaches:
WHERE column <> 'something'
WHERE column NOT LIKE 'something'
WHERE column not in('something')
Upvotes: 2
Reputation: 1270
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)
Upvotes: 1
Reputation: 3960
with NOT IN, usage is like IN
SELECT * FROM USERS WHERE ID NOT IN (1,2,3,4,5)
Upvotes: 5