Let's say I have a table of real estate properties:
A 15,000 B 50,000 C 100,000 D 25,000
I would like to group them by 0 - 49, 999, 50 000 - 99 999 and 100 000 - 200 000
Thus, the result should be:
0 - 49k (2) 50k - 99k (1) 100k - 200k (1)
Is there a way to do this in a single SQL statement? By the way, I'm using Postgres.
sql count group-by postgresql
David
source share