Oh, that takes a load of my mind.
I currently use the following expression in Sql Server
Select year, quarter, price, ntile(3) over (partition by year, quarter order by price)
to retrieve something like ABC Price-Ranges for each quarter.
I don't know how much work it is, to simulate this in a stored procedure for MySql. Unfortunately I can't find any sample code on the Internet. This doesn't make me very confident.
How many lines of Code will such a procedure have, about 10, 50 or maybe 100?
Do you know any sample Code or can give me hint where to look at?