Arrays - selecting (and not removing) duplicates...

Поиск
Список
Период
Сортировка
От Pól Ua Laoínecháin
Тема Arrays - selecting (and not removing) duplicates...
Дата
Msg-id CAF4RT5TLXD7rtCYBf4SoP7tzD2jDRtVU5gpQjHk+-VJ5NJC3_A@mail.gmail.com
обсуждение исходный текст
Ответы Re: Arrays - selecting (and not removing) duplicates...  (hubert depesz lubaczewski <depesz@depesz.com>)
Список pgsql-general
Hi all,

Suppose I have two arrays (TEXT, INT - not important - prefer INT) as follows:

x = {1, 4, 5, 6, 6, 7, 8, 9, 9, 9, 9, 10, 12, 12}

I would like a result of:

y = {6, 9, 12}

I'm aware of the UNNEST function and that I can convert the array into
rows and do a COUNT(blah) HAVING COUNT(blah) > 1 and then ARRAY_AGG
back.

I was just wondering if there is some (already written) function out
there that will drop this functionality into my lap?

TIA and Rgs,


Pól...



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

Предыдущее
От: Mario Emmenlauer
Дата:
Сообщение: lib and share are installed differently, but why?
Следующее
От: Avi Weinberg
Дата:
Сообщение: get current worker processes count