COALESCE or CASE more efficient and/or standard

耗尽温柔 提交于 2019-12-02 02:44:03

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 NULLs anyway.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!