I have a database of products with prices. What I'd like to be able to do is figure out 5 different price ranges such that each range, when ordered by price, will have approximately the same number of rows in it, i.e., if the database has 25 products in it, I'd like to be able to to find out the
MAX price of the 5 lowest priced products, the max price of the second group of 5 lowest priced products, etc.
Something along the lines of:
SELECT MAX(price) FROM products GROUP BY count(5)
I realize that using count(5) in the
GROUP BY won't work, I'm just curious if something like this is even possible?