SQL Server - Include NULL using UNPIVOT

前端 未结 7 1575
暖寄归人
暖寄归人 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:03

    or, in SQLServer 2008 in shorter way:

    ...
    cross join 
    (values('col1'), ('col2'), ('col3'), ('col4')) column_names(column_name)
    

提交回复
热议问题