Re: query, probably needs window functions

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: query, probably needs window functions
Дата
Msg-id CAKFQuwZN54-whR79O7sJx8p60YzpLjD7Xo8CP3oXWwwySSzHVQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: query, probably needs window functions  (Michael Lewis <mlewis@entrata.com>)
Список pgsql-general
On Fri, May 22, 2020 at 12:38 PM Michael Lewis <mlewis@entrata.com> wrote:
I believe something like this is what you want. You might be able to do it without a sub-query by comparing the current name value to the lag value and null it out if it's the same.

This.  I misread the question.  You might also consider just outputting one row per person and output the related phone numbers using string_agg(phone.number, E'\n')

David J.

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

Предыдущее
От: Michael Lewis
Дата:
Сообщение: Re: query, probably needs window functions
Следующее
От: Thomas Munro
Дата:
Сообщение: Re: Help understanding SIReadLock growing without bound on completed transaction