When comparing two values x and y, if either x or y is NULL, then some logical comparisons evaluate to an UNKNOWN value rather than true or false. It is called Three-Value Logic.
The query filters (ON, Having, Where) treat UNKNOWN as FALSE. Rows with a filter value of unknown are excluded from the result set.
Refer to this article for some samples: Understanding the Use of NULL in SQL Three-Valued Logic.
Best regards,
Cosmog Hong
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our Documentation to enable e-mail notifications if you want to receive the related email notification for this thread.