From: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> |
---|---|
To: | Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com> |
Cc: | Márcio A(dot) Sepp <marcio(at)zyontecnologia(dot)com(dot)br>, pgsql-general <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: help with generation_series in pg10 |
Date: | 2018-01-09 05:42:43 |
Message-ID: | CAKFQuwaHkjU47EHin7_7JRjvC1SL-pL=HvUyNVHepuLqRaLpwA@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Monday, January 8, 2018, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com> wrote:
>
> I am not seeing a solution, but you might see something that would help
> you.
There is no general solution. For the problem at hand I would union two
generate_series(1,5) queries with a query_id column. Then I'd use
row_number() over (order by query_id, series_num) to compute the column
containing the values 1-10.
Alternatively, use the modulus operator (% 5) on 1-10 to generate the
second column.
David J.
From | Date | Subject | |
---|---|---|---|
Next Message | Agnar Renolen | 2018-01-09 09:48:04 | Getting started with first user. |
Previous Message | Adrian Klaver | 2018-01-09 05:19:24 | Re: help with generation_series in pg10 |