mysql - SQL BUG doesn't accept null when write != -


this question has answer here:

when write column!=something doesn't choose null value , something. why happened? can prevent writing , column null?

you need check null too.

select  * your_table column <> or column null 

note: cannot compare null null.

let's @ following code snippets:

set @v := null; select @v = null; result: null; because null can compared using null  select @v null; result: 1 (i.e. true) 

the null value can surprising until used it. conceptually, null means “a missing unknown value” , treated differently other values.

to test null, use null , not null

working null values in mysql


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -