I have a MySQL table and I want to extract all rows except if the column contains a specific value. Is this possible?
My table structure
+----+------+------+------+
| ID | col1 | col2 | col3 |
+----+------+------+------+
| 1 | blah | blah | boo |
+----+------+------+------+
| 2 | blah | blah | blah |
+----+------+------+------+
| 3 | blah | blah | boo |
+----+------+------+------+
So if col3 contains boo, don’t extract that:
+----+------+------+------+
| ID | col1 | col2 | col3 |
+----+------+------+------+
| 2 | blah | blah | blah |
+----+------+------+------+
It’s certainly possible. The following code should do the trick
If you’re looking where more than one column, than add the following afterwords:
for every column you need.
Assuming, of course, that you mean that you DON’T want boo. If you want only boo, then take away the exclamation point.