SQL Server - Include NULL using UNPIVOT

前端 未结 7 1554
暖寄归人
暖寄归人 2020-12-09 03:40

UNPIVOT will not return NULLs, but I need them in a comparison query. I am trying to avoid using ISNULL the following ex

相关标签:
7条回答
  • 2020-12-09 04:07

    It's a real pain. You have to switch them out before the UNPIVOT, because there is no row produced for ISNULL() to operate on - code generation is your friend here.

    I have the problem on PIVOT as well. Missing rows turn into NULL, which you have to wrap in ISNULL() all the way across the row if missing values are the same as 0.0 for example.

    0 讨论(0)
提交回复
热议问题