2021年4月6日星期二

Pivot without aggregate to list all contents non character

I have

ab cd
1 a
2 b
3 b
8 c

I want

a b c
1 2 8
NULL 3 NULL

I tried

select a, b, c  from aib  pivot  (      max(ab)      for cd in (a,b,c)  ) k  

but I am not able to list all the values as aggregate function is a must for pivot function

https://stackoverflow.com/questions/66978841/pivot-without-aggregate-to-list-all-contents-non-character April 07, 2021 at 10:36AM

没有评论:

发表评论