pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Achilleas Mantzios <achill@matrix.gatewaynet.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: serie of serie
Date: Sat, 18 Apr 2020 16:25:35 +0300
Message-ID: <0daf254f-873b-3c25-da03-e3c0d39e4893@matrix.gatewaynet.com> (raw)
In-Reply-To: <04d801d61551$8d6acf90$a8406eb0$@gmail.com>
References: <04d801d61551$8d6acf90$a8406eb0$@gmail.com>


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&...; 
> 	Garanti sans virus. www.avast.com 
> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&...; 
>
>
> <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

view thread (3+ messages)

Message-ID: <0daf254f-873b-3c25-da03-e3c0d39e4893@matrix.gatewaynet.com>
Permalink:  ../0daf254f-873b-3c25-da03-e3c0d39e4893@matrix.gatewaynet.com/
Also on:    postgresql.org/message-id/0daf254f-873b-3c25-da03-e3c0d39e4893@matrix.gatewaynet.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: achill@matrix.gatewaynet.com
  Subject: Re: serie of serie
  In-Reply-To: <0daf254f-873b-3c25-da03-e3c0d39e4893@matrix.gatewaynet.com>
  References: <04d801d61551$8d6acf90$a8406eb0$@gmail.com> <0daf254f-873b-3c25-da03-e3c0d39e4893@matrix.gatewaynet.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox