October 21, 2024
Chicago 12, Melborne City, USA
SQL

Why is the syntax “column = NULL” allowed in SQL?


I know this question doesn’t really belong here, because I ask for an explanation and not for a solution to a problem. If there is a better place to ask it, feel free to redirect me.

I understand the difference between column IS NULL and column = NULL in SQL, multiple answers such as this one explain it very well. There is also an interesting paragraph on Wikipedia that explains in detail how it is expected to work.

But what I don’t get is : why ? There is an obvious risk of confusion between the two syntaxes. I can tell, that’s how I just discovered that column = NULL was allowed… And since column = NULL will always return nothing, what’s the point ? Why not have it forbidden or make it an equivalent of column IS NULL ? Is there any legit use case for this syntax ?



You need to sign in to view this answers

Leave feedback about this

  • Quality
  • Price
  • Service

PROS

+
Add Field

CONS

+
Add Field
Choose Image
Choose Video