DEV Community

AquaCat
AquaCat

Posted on

【MySQL】When using "NULL" in WHERE CLAUSE

Do not write

SELECT * FROM [table_name] WHERE [column_name]=NULL;
Enter fullscreen mode Exit fullscreen mode

Use "IS" for NULL!!!!

SELECT * FROM [table_name] WHERE [column_name] IS NULL;
Enter fullscreen mode Exit fullscreen mode

I wasted 2hours for this...

Top comments (0)

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay