public inbox for [email protected]
help / color / mirror / Atom feedFrom: Alexey M Boltenkov <[email protected]>
To: SQL Padawan <[email protected]>
To: [email protected] <[email protected]>
Subject: Re: Strange sequences - how to construct?
Date: Sat, 23 Oct 2021 16:54:07 +0300
Message-ID: <[email protected]> (raw)
In-Reply-To: <tiUZZ67DYCE5aY4wDAfIXjzlghyf4ndcG2m7wWRd0Rq3rtyhd38iJ9fN2iG088MxWOQtEBlEbsLXzqq-RUYer6rXXfS67pjdwthg8YRIgQU=@protonmail.com>
References: <tiUZZ67DYCE5aY4wDAfIXjzlghyf4ndcG2m7wWRd0Rq3rtyhd38iJ9fN2iG088MxWOQtEBlEbsLXzqq-RUYer6rXXfS67pjdwthg8YRIgQU=@protonmail.com>
On 10/22/21 22:29, SQL Padawan wrote:
>
> Good afternoon to everybody.
>
> I wish to construct some weird sequences.
>
> 1
> 1
> 2
> 2
> &c.
>
> and with 3 ones, 4 ones... &c.
>
> Now, I know how to do a simple
> 1
> 2
> 3
> 4
>
> using both GENERATE_SERIES and using a RECURSIVE CTE.
>
> What I would like is to be able to construct my specified sequences
> using *_both_* GENERATE_SERIES *_and_* RECURSIVE CTEs.
>
> Regards,
>
> SQL Padawan!
>
>
>
>
> Sent with ProtonMail <https://protonmail.com/; Secure Email.
>
GENERATE_SERIES: select unnest(array[x, x]) x from generate_series(1, 5) x;
RECURSIVE CTE: with recursive x as ( select 1 x union all select x + 1
from x where x < 5) select unnest(array[x, x]) x from x;
view thread (6+ messages) latest in thread
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 using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: Strange sequences - how to construct?
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox