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

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: How best to turn select result into options like 'a|b|c''
Дата
Msg-id CAKFQuwY2norL3CZLWt9srwqwU5NE-cqTsZ5dkCzJuQL+B7kvEQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: How best to turn select result into options like 'a|b|c''  ("Ray O'Donnell" <ray@rodonnell.ie>)
Список pgsql-general
On Mon, Dec 20, 2021 at 3:24 PM Ray O'Donnell <ray@rodonnell.ie> wrote:
On 20 December 2021 22:10:19 Shaozhong SHI <shishaozhong@gmail.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.


Or just: string_agg()

David J.

В списке pgsql-general по дате отправления:

Предыдущее
От: "Ray O'Donnell"
Дата:
Сообщение: Re: How best to turn select result into options like 'a|b|c''
Следующее
От: James Sewell
Дата:
Сообщение: Re: Max connections reached without max connections reached