Re: How to remove an item from integer array type

Поиск
Список
Период
Сортировка
От Alban Hertroys
Тема Re: How to remove an item from integer array type
Дата
Msg-id A7BF4F9C-FF1E-48BB-8421-7A3150EC4FD1@gmail.com
обсуждение исходный текст
Ответ на Re: How to remove an item from integer array type  (ChoonSoo Park <luispark@gmail.com>)
Список pgsql-general
On Feb 20, 2013, at 17:51, ChoonSoo Park <luispark@gmail.com> wrote:

> Sorry,
>=20
> It's not ordered by value. It's not sorted list unfortunately. It can =
be '{100, 120, 102, 130, 104}'.

Are you saying it's an unordered list for which the order matters? That =
seems a bit peculiar.

What would probably work is to split the array around the value to =
remove, and merge those arrays again.
Something like this:

=3D> select (ARRAY[100, 101, 102, 103, 104])[1:2] || (ARRAY[100, 101, =
102, 103, 104])[4:5];
 ?column?
 -------------------
 {100,101,103,104}
 (1 row)=20
    =20

Alban Hertroys
--
If you can't see the forest for the trees,
cut the trees and you'll find there is no forest.

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

Предыдущее
От: Russell Keane
Дата:
Сообщение: Re: How to remove an item from integer array type
Следующее
От: Nathan Boley
Дата:
Сообщение: Foreign Exclusion Constraints