I have a query similar to belowselect type, A, B, C, D, Efrom (select type, organisationfrom table1) as rpivot(select sum(price)for organisation in ([A], [B], [C], [D], [E])) as sumofpivot
The values of column "organisation" keeps changing and so I have to again and again modify the code to include the new columns. Is there anyway to add new columns automatically based on the values of column organisation and keep updating ?