I can see RANK() and DENSE_RANK() being emulated, but how do you emulate 
ROW_NUMBER() with joins? Do you remember what strategy you were looking at 
at the time you had a look at the implementation?

Am Mittwoch, 27. November 2013 09:01:20 UTC+1 schrieb Noel Grandin:
>
> Hi 
>
> I had a brief bash at this, but it's a little painful. 
> Most DB's implement window functions by translating them into an 
> additional joins. 
> If you google around for how to translate window functions to joins you'll 
> find the strategy somewhere. 
>
> But the hard part, is that we have limited support for query 
> transformation. 
> You'd need to hook into the optimize() method call on the Prepared 
> subclasses, and teach them how to transform the 
> Select such that the window function is an extra join. 
>
> Regards Noel 
>
> On 2013-11-27 01:00, Daniel Gredler wrote: 
> > Hi guys, 
> > 
> > I'm thinking of taking a crack at implementing window / analytic 
> functions like ROW_NUMBER, RANK and DENSE_RANK -- but 
> > it's a little daunting. Does anyone have any hints, pointers or advice? 
> We have one use case for this, but I'm afraid 
> > that scratching this itch may be more painful than just allowing it to 
> continue to itch :-) 
> > 
> > Take care, 
> > 
> > Daniel 
> > 
> > 
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to