Reputation: 1905
I have table A
A
+--------+------+
| values | data |
+--------+------+
| 11 | 4 |
+--------+------+
| 22 | 5 |
+--------+------+
| 33 | qwe |
+--------+------+
| 44 | 7 |
+--------+------+
| 55 | zui |
+--------+------+
and this SQL
SELECT * FROM A WHERE data NOT IN (4,5,7)
So the expected result is
33
55
because qwe
and zui
are NOT IN
(4,5,7)
.
But the result is empty. No rows are returned.
How can I fix this?
Upvotes: 1
Views: 77
Reputation: 32021
as data is varchar column so quote them as a like string
SELECT * FROM A WHERE data NOT IN ('4','5','7')
Upvotes: 3