Re: How best to turn select result into options like 'a|b|c''

From: "Ray O'Donnell" <ray(at)rodonnell(dot)ie>
To: Shaozhong SHI <shishaozhong(at)gmail(dot)com>, "pgsql-general" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: How best to turn select result into options like 'a|b|c''
Date: 2021-12-20 22:23:56
Message-ID: 17dd9f16258.2834.f9dd809031fc0469edf0bbbf79c1d468@rodonnell.ie
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 20 December 2021 22:10:19 Shaozhong SHI <shishaozhong(at)gmail(dot)com> wrote:
> Is there a way to turn select result into something like 'a|b|c' .
> Regards,
> David

On my phone so hard to reply properly, but if a, b and c are in separate
rows then you need the array_agg() and array_to_string() functions.

Ray.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2021-12-20 22:37:12 Re: How best to turn select result into options like 'a|b|c''
Previous Message Shaozhong SHI 2021-12-20 22:10:05 How best to turn select result into options like 'a|b|c''