COALESCE or CASE more efficient and/or standard

前端 未结 2 1889
暖寄归人
暖寄归人 2021-01-19 13:31

In terms of x compared to y.

  • Does x comply with sql standards better? [apologies if subjective]
  • Is x more efficient than y?
  • Or are these
2条回答
  •  长发绾君心
    2021-01-19 13:38

    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.

提交回复
热议问题