Perform Operations on Dynamic Columns from Pivot
问题 As The Question says that I'm Trying to insert some values from dynamic sql Query to TempTable using Pivot, so the ExistingCoulmnName are not known to me In the next step I want to perform some arithmatic operation lets say multipliation on those Column Values. How Can I do that? Attaching Some samples : select @cols = STUFF((SELECT ',' + QUOTENAME(FYYear) from #TempCapEx group by FYYear order by FYYear FOR XML PATH(''), TYPE ).value('.', 'NVARCHAR(MAX)') ,1,1,'') set @query = 'SELECT