Re: [GENERAL] function returning a merge of the same query executed X time

2015-04-23 Thread Marc-André Goderre
27; (pgsql-general@postgresql.org) Objet : Re: [GENERAL] function returning a merge of the same query executed X time Can you not just CROSS JOIN it to generate_series(1, 8)? On 22 April 2015 at 14:14, Marc-André Goderre wrote: Hi all, I'm having difficulties to  create a function that s

Re: [GENERAL] function returning a merge of the same query executed X time

2015-04-22 Thread Adrian Klaver
On 04/22/2015 06:14 AM, Marc-André Goderre wrote: Hi all, I'm having difficulties to create a function that should execute X time the same query and return their results as a single table. I tried this way but it don't work : Thanks to help. See comments inline. create function cm_get_json

Re: [GENERAL] function returning a merge of the same query executed X time

2015-04-22 Thread Geoff Winkless
Can you not just CROSS JOIN it to generate_series(1, 8)? On 22 April 2015 at 14:14, Marc-André Goderre wrote: > Hi all, > I'm having difficulties to create a function that should execute X time > the same query and return their results as a single table. > I tried this way but it don't work :

Re: [GENERAL] function returning a merge of the same query executed X time

2015-04-22 Thread Jim Nasby
On 4/22/15 8:14 AM, Marc-André Goderre wrote: select row_to_json(q) from (select row_number() over() as id, sum(cost) as total_cost,sum(length) as total_length,json_agg(row_to_json(r)) as data from (select * from cm_get_loop_route_4(2, 10, -73.597070, 45.544083))r)q