help me please with such a task please: i have a table
patient id | loc1 | loc2 | loc3 | …. | locN |
---|---|---|---|---|---|
3545 | 0 | 0 | 1 | 0 | |
3546 | 0 | 0 | 0 | …. | |
3547 | 1 | 0 | |||
3548 | 0 | 1 …… | |||
…. |
How can i sum up all numbers in each column and get the next table:
| loc | sum |
| ——– | ——– |
| loc1 | 745 |
| loc2 | 122 |
…
| locN | 2734 |
Thanks in advance for any idea!
I know how to sum up all values of each selected column, but i have about 20 columns, so i want to do this automatically for all ones.
New contributor
Irina V. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.