i got kind of upset about my inability to get this to work and since I’ve already wasted half a day on this rather simple problem I’ll give up on it and ask you guys.
So i have a SQL table where the last column is named flag:
name: type: collation: null: default:
...
flag varchar(250) utf8mb4_unicode_520_ci yes NULL
The data has either double or NULL as value and i want to select all the data which isn’t double. But no operator gives any result, like:
SELECT * FROM `table` WHERE `flag` NOT LIKE 'double';
SELECT * FROM `table` WHERE `flag` NOT LIKE '%double%';
SELECT * FROM `table` WHERE `flag` NOT LIKE '%d%';
SELECT * FROM `table` WHERE `flag` != 'double';
SELECT * FROM `table` WHERE NOT flag = 'double';
i checked every typo, there are no strange/hidden symbols in the data. Of course i could do a
SELECT * FROM table WHERE flag IS NULL
which works atm, but there will be other flags > not useful.
Any clue what’s the problem here?
melonlemon is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.