visch
07/19/2021, 1:25 AMvisch
07/19/2021, 1:26 AMvisch
07/19/2021, 1:32 AMDeclare @a varchar = NULL
Declare @b varchar = '1'
Select IIF(@a = @b, 'TRUE', 'FALSE') --Evals to False
Select IIF(NOT(@a = @b), 'TRUE', 'FALSE') -- False again, quay?
Spent way too long on this! Ends up being that I don't understand that SQL doesn't return just True and False. It also returns Unknown. https://modern-sql.com/concept/three-valued-logic
Oh wow I had no clueedward_smith
07/19/2021, 12:56 PMIS [NOT] DISTINCT FROM
before because of this issue, but I never thought more about than "because you can't use equality with nulls". Good read!visch
07/19/2021, 1:14 PMIS DISTINCT FROM
so you get https://stackoverflow.com/questions/10416789/how-to-rewrite-is-distinct-from-and-is-not-distinct-from