In terms of x compared to y.
COALESCE
is essentially a shorthanded CASE
statement.
Both are exactly the same.
There is also ISNULL
in SQL Server (differs in other DBMSs), but that's actually a non-standard feature and is actually more limited that COALESCE
.
In this case I would use COALESCE
( which provides more levels than ISNULL
) rather than the CASE
stement.
The CASE
statement seems a bit bulky here, seeing as you are only checking for NULL
s anyway.