Skip to content
Advertisement

Count entries by ranges?

I have a table like so:

I need query which returns this:

Count of users with this sum of amounts(balance)

Advertisement

Answer

You have to aggregate twice. The first time to SUM amount for each user. The second time to count the number of users for each amount.

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