From: | ChoonSoo Park <luispark(at)gmail(dot)com> |
---|---|
To: | Russell Keane <Russell(dot)Keane(at)inps(dot)co(dot)uk> |
Cc: | PG-General Mailing List <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: How to remove an item from integer array type |
Date: | 2013-02-20 17:26:26 |
Message-ID: | CACgbiFsjSNg6=6ybdokSL70wQLT3JLazkhzhVp64_Ym+Odacig@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
It works!
Thank you,
Choon Park
On Wed, Feb 20, 2013 at 12:06 PM, Russell Keane <Russell(dot)Keane(at)inps(dot)co(dot)uk>wrote:
> ** **
>
> >>Sorry,****
>
> >>** **
>
> >>It's not ordered by value. It's not sorted list unfortunately. It can
> be '{100, 120, 102, 130, 104}'.****
>
> >>** **
>
> >>Do you have other suggestion?****
>
> >>** **
>
> >>Thank you,****
>
> >>Choon Park****
>
> >** **
>
> >This should work:****
>
> >update a set f2 = (select array_agg(X.id) from (select f1, unnest(f2) id
> from a where f1 = 1 except select 1 f1, 101 id) X) where f1 = 1;****
>
> ** **
>
> And with the correct table name:****
>
> update tableA set f2 = (select array_agg(X.id) from (select f1, unnest(f2)
> id from tableA where f1 = 1 except select 1 f1, 101 id) X) where f1 = 1;**
> **
>
> ** **
>
> ** **
>
> ** **
>
> Regards,****
>
> ** **
>
> *Russell Keane***
>
> *INPS*****
>
> * *
>
> Tel: +44 (0)20 7501 7277****
>
> [image: cid:image001(dot)jpg(at)01CDBE9B(dot)11D013F0]****
>
> Follow us <https://twitter.com/INPSnews> on twitter | visit www.inps.co.uk
> ****
>
> ** **
>
> ** **
>
> ** **
>
From | Date | Subject | |
---|---|---|---|
Next Message | Ian Lawrence Barwick | 2013-02-20 17:29:50 | Re: How to remove an item from integer array type |
Previous Message | Russell Keane | 2013-02-20 17:06:57 | Re: How to remove an item from integer array type |