Re: serie of serie

From: Achilleas Mantzios <achill(at)matrix(dot)gatewaynet(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: serie of serie
Date: 2020-04-18 13:25:35
Message-ID: 0daf254f-873b-3c25-da03-e3c0d39e4893@matrix.gatewaynet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On 18/4/20 10:18 π.μ., Olivier Leprêtre wrote:
>
> Hi,
>
> I would like to generate a serie of serie and didn’t find how.  With
> generate_series. I can generate a serie
>
> 1
>
> 1
>
> 1
>
> 2
>
> 2
>
> 2
>
> 3
>
> 3
>
> 3
>
> But how can I repeat this serie several times ?
>
> 1
>
> 1
>
> 1
>
> 2
>
> 2
>
> 2
>
> 3
>
> 3
>
> 3
>
> 1
>

with foo as (select floor(a) as a from
generate_series(1.33333333333333333333,4,1.0/3.0) as s(a))
select foo.a from foo, generate_series(1,10) as itera(b) order by b,a;

> 1
>
> 1
>
> 2
>
> 2
>
> 2
>
> 3
>
> 3
>
> 3
>
> 1
>
> 1
>
> 1
>
> 2
>
> 2
>
> 2
>
> 3
>
> 3
>
> 3
>
> Thanks for any help,
>
>
> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient>
> Garanti sans virus. www.avast.com
> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient>
>
>
> <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2020-04-18 16:24:32 Re: Replication issue
Previous Message Rory Campbell-Lange 2020-04-18 09:00:22 Re: serie of serie