Say I have a table of real estate properties:
A 15,000 B 50,000 C 100,000 D 25,000
I\'d like to group them by 0 - 49,999, 50,000 - 99,99
You can GROUP BY an experession, something like that:
GROUP BY
SELECT price/50000*50000 AS minPrice, (price/50000+1)*50000-1 AS maxPrice, COUNT(*) FROM table GROUP BY price/50000;