var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Ntile with MySql
is there a way to do Ntile with MySql? Maybe with stored Procedure or something else?
If not, do you have an idea, how to simulate on Client-Side, using c# and ado?
yes, a stored procedure can do anything
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?
oh, i'd say it would have maybe somewhere between 9 and 37 lines of code, give or take
the stored proc would run this query:
and then process the rows in sequence
SELECT year, quarter, price
BY year, quarter, price
And what about Sql-Function, is it possible to create such a Sql-Function, so I can use it in the select statement? Just like ntile for Sql Server.