ActionIQ interview question

Selecting sums from a table