Hi ,
I am wondering if case is allowed in pivot.
For example,
instead of directly doing pivot( sum(Amt1) for Col1 in (a,b,c))
i want to do it this way...
pivot ( case when @Var = 'TBT' then sum(Amt1)
when @Var = 'BBT' then sum(Amt2) end
for Col1 in (a,b,c))
Is this Possible?
Can you suggest me a way to acheive this?
Thanks,