I have 10 tables named T1, T2, T3, ...,T10 and each store columns named ID, C1, C2, C3 ...., C100.
I want to create a summary tables which stores the sum of corresponding columns i.e. T1.C1 + T2.C1 + T3.C1, T1.C2 + T2.C2 + T3.C2 and so on.
If there was only few columns I could have done something as:
select T1.C1 + T2.C1 + T3.C1 as C1, T1.C2 + T2.C2 + T3.C2 as C2
from T1
inner join T2
on T1.ID = T2.ID
inner join T3
on T1.ID = T3.ID
but I have 100 columns to add and I have large number of tables.