Difference between empty ENUM value

The review_type parameter value for all my files is empty (but not null)

review_type is defined as follows ENUM('','a','m','f')

All 1108 records look like this

enter image description here

But 1000 records are not returned when searching for records with an empty review_type element. And when I search for posts without an empty review type, I get 0. What about those 1000 posts? How is this possible?

SELECT id, review_type FROM stuff; -- 1108 records
SELECT id, review_type FROM stuff WHERE review_type=''; -- 108 records
SELECT id, review_type FROM stuff WHERE review_type!=''; -- 0 records
-- column type is defined as NOT NULL, but just to be sure:
SELECT id, review_type FROM stuff WHERE review_type IS NULL; -- 0 records

      

+3


source to share


1 answer


1000 missing records matter 0

If you set the ENUM value to 0, it gets an empty value other than the empty I defined ENUM('','a','m','f')

that matters 1

.



There are two different blanks. ''

refers to mine, but 0

lets me get another

0


source







All Articles