Yes, you read that right. SQL does treat all NULL values differently. I learnt this a while back while working on Convoy and again on LiteQueue: a Golang a queueing library.

Basically, any column with a UNIQUE constraint can have multiple NULL values, because each NULL value is a distinct value that is different from other NULLs, and this is even less obvious if you’re used to using ORMs. I tested this with SQLite, Postgres and MySQL and they all behave like this. Let’s prove this with some examples

continue reading on jirevwe.github.io

⚠️ This post links to an external website. ⚠️