On 13-09-15 15:45, Abilio Marques wrote: > This is for making a quick question and leaving a note: > ?? > > What is a recursive aggregate query? What is it useful for? Been using SQL > for a while, and is the first time I face the term. I even used Oracle for > a year and a half, and never saw a CONNECT BY (seems to be a proprietary > equivalent) in all the queries I ever saw (I did code maintenance from time > to time).
for example, you can calculate a factorial using a 'recusive query': ('42' is just used as a random number to stop....) WITH factorial (n, f) AS ( SELECT 1, 1 UNION ALL SELECT n+1, (n+1)*f FROM factorial WHERE n<42 ) SELECT * FROM factorial; an 'recursive aggregate query' also uses 'agregate' functions (like SUM, MIN, MAX,...) and this is where this thread was about.... (i cannot think of a simple example..... ;( > > > To cut straight to the point, maybe Wikipedia shouldn't mention SQLite (if > it's really buggy), and I believe someone with the understanding of the > SQLite reality perhaps should go and edit the article: > > https://en.wikipedia.org/wiki/Hierarchical_and_recursive_queries_in_SQL sQlite work ok with a 'recursive query', but it seems not to do so with a 'recursive agregate query'