I have got a table 'payments'
user_id amount
1 300
1 100
2 100
2 100
3 10
4 200
What query should I make to display result by groups:
diapason number
0 -10 0
10 - 100 1
100 -200 3
more than 200 2
I think I should use 'having'?