Hi,

Am 19.11.2011 01:04, schrieb Vlad Khorsun:
>>>       Because standard prohibits any kind of aggregates in recursive CTE 
>>> members.
>>>

So this would mean option b) is correct:

b) [ ] window functions are not supposed to work in the "child select"
      part of recursive CTEs

- since Window functions belong to <aggregate function> | <grouping 
operation> ?

I was just trying to use an apparent side effect of the Window
functions to get my Child select ordered: when you use e.g.
row_number() over (partition by <group_field>)
in a Select that has no explicit Order By clause, it seems(!) to order
the result set as if you did an Order By <group_field>,row_number.

(I doubt that would be a safe way to do that "implicit" ordering in
a consistent way, anyway - like what if you use TWO window functions?)

That said, imho the server should complain when you try to use a
window function in the recursive child select, instead of happily
returning rows :-) - or at least it should be documented in the
Release Notes for the window functions.


P.S. on further investigation - it's not an _endless_ recursion,
after 1024 rows you get an error "Too many concurrent executions
of the same request" - which is where it hits the hard-coded limit
for the maximum recursion depth i guess. The good news: it doesn't
crash the server, so you can try again :-)


cheers,
Frank



------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to