pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: h012@ied.com
To: pgsql-sql@postgresql.org
Subject: expressions operating on arrays
Date: Fri, 9 Aug 2002 00:38:20 -0400 (EDT)
Message-ID: <no.Yo.N.nN.0208090032250.2280-100000@business.com> (raw)



 Hi,

  I would like to say:

create table test1 (array1 int4[]);
insert into test1 values ('{123,234,345}');
insert into test1 values ('{456,567,678}');

 now what I don't know how to do:

-- consider contents of array:
select * from test1 where array1 CONTAINS 567;

-- APPEND '789' to array in second row:
update test1 set array1=(select array1 from test1 where array1 CONTAINS 
'567' UNION select '789');


 How do I go about expressing and operating on the contents of an array ?


    Thanks,

       John

-- 
-- Gospel of Jesus is the saving power of God for all who believe --
               ## To some, nothing is impossible. ##
                     http://Honza.Vicherek.com/




view thread (7+ messages)  latest in thread

Message-ID: <no.Yo.N.nN.0208090032250.2280-100000@business.com>
Permalink:  ../no.Yo.N.nN.0208090032250.2280-100000@business.com/
Also on:    postgresql.org/message-id/no.Yo.N.nN.0208090032250.2280-100000@business.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: h012@ied.com
  Subject: Re: expressions operating on arrays
  In-Reply-To: <no.Yo.N.nN.0208090032250.2280-100000@business.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox