1

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?

a_horse_with_no_name
  • 440,273
  • 77
  • 685
  • 758
Jakob
  • 1,448
  • 2
  • 10
  • 22

1 Answers1

3

as data is varchar column so quote them as a like string

SELECT * FROM A WHERE data NOT IN ('4','5','7')
Zaynul Abadin Tuhin
  • 28,879
  • 5
  • 20
  • 49