I am getting an output from an SQL query in the form of an array of tuples. The array looks like this-
(1, 100)
(2, 150)
(3, 200)
I want to find the sum of the columns seperately. Thus, I want to get the value 1+2+3= 6 for column 1, and also get the value 100+150+200= 450 for column 2.
When I use the built-in var1=sum(arr[0])
, I get 101, which is the sum of the first row instead of column.
How do I add up the first column in the easiest manner?