Skip to content
Advertisement

How to get the sum of a subquery that returns sums?

I would like to get the sum of the “sums” in the following case. How can I do that? The following picture represents the table I receive after performing the code below. I’d like to receive only 2 records which would be:

Or Gazit | 052-3322445 | 36400

Dan Guy | 050-3023322 | 12000

An image representing the table I'm getting

Thanks.

Advertisement

Answer

Either I am misunderstanding your requirement or you are over-complicating this. Seems like you just need some aggregation (i.e. sum) with a group by clause. Does this work for you?

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement