I\'m trying to get sums of conditional values and group by minute.
I succeeded with the following query but results takes some time and wonder is there any efficient