MySQL – NULL vs ” vs ‘NULL’
Today, in one of my project I’ve to check empty fields.
The field name is: answer it’s type is TEXT and Default value is NULL
In my SQL query I was checked at first answer != NULL (if the answer is not null, i.e if the answer is not empty), But this was not showing the correct result.
Then I changed it to answer != ” ( i.e ” means empty string) then it showed the correct result.
Then I test with this answer != ‘NULL’, and it also showed the correct result.