I have a table with many columns (dynamically generated columns) and a rows with USER_KEY
(which has type INT
).
Type of dynamic added columns is DECIMAL(15,2)
.
My table looks like this:
What I would like to do is get summary for each user for all columns in that row. Since there are so many of them dynamically generated, I can not hard type this. How to do this?
I also have variable @COLDEPARTMENTS
, where all those dynamic columns are separated by comma, like this:
[120000003],[120000002],[140000001],[120000005],[120000021],[120000025]