
Stefano, What you wrote does not look like an aggregation. This is an aggregation: you make groups on value1,value2, and for each group you aggregate values (e.g. value3,value4). select value1, value2, my_aggr_function(value3, value4) from table group by value1, value2 However, if that returns more than one tuple per group, it's again not an aggregation. I have the impression that what you are looking for is: for every tuple (which might come from a previous aggregation), return a table, and concatenate the results. This would look like: select * from ( (select * from my_func(x.value1, x.value2) from (select distinct value1,value2 from table) as x) ); This is possible in MonetDB. It will make a table out of each distinct (value1,value2) pair, and give you back the concatenation of all results (mind the double parentheses in the from clause, they are needed). I have done this and works well. Roberto On 9 June 2016 at 15:18, Stefano Fioravanzo <fioravanzos@gmail.com> wrote:
Hello,
I have an embedded python function which, given two integer parameters, after doing some stuff returns a table. I would like to group by a table by these two input parameter, and for each resulting group call the function. The result would be the concatenation of all the tables returned by the function.
I understand that a thing like this would be very easy if the function returned just one value e.g.: select my_aggr_function(value1, value2) from table group by value1, value2
But how can I do this if my_aggr_function returns multiple rows??
Thank you,
Stefano _______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list