Answer the question
In order to leave comments, you need to log in
How to exclude one value from SQL when displaying information?
Good afternoon. Can you please tell me how to exclude one value when displaying information from a SQL table?
For example, I get everything without specifying WHERE: SELECT * FROM `table_1`
Now the news is displayed with all statuses `enabled` (y,n,m,x).
And I need to display absolutely everything write down, but not display exactly those where, for example, `enabled` = 'x'.
How can I do that ?
Is there an exception method? NOT IN?
Answer the question
In order to leave comments, you need to log in
SELECT * FROM table_1 WHERE enabled NOT IN (1,2,3,4)
SELECT * FROM table_1 WHERE enabled != 'x'
Yes and just != not equal to not in
`enabled` not in ('x', 'y')SELECT * FROM `table_1` WHERE `enabled` != 'x'
In addition: you may need a mySQL FIND_IN_SET statement, don't forget that.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question