From: Marcin Mazurek - Multinet SA - Poznan <m.mazurek@multinet.pl>
To: Karel Zak - Zakkr <zakkr@zf.jcu.cz>
Cc: pgsql-sql@postgreSQL.org
Subject: Re: [SQL] arrays
Date: Thu, 2 Dec 1999 12:01:15 +0100 (CET)
Message-ID: <Pine.BSF.3.96.991202115951.14919E-100000@arka> (raw)
In-Reply-To: <Pine.LNX.3.96.991202110153.29170A-100000@ara.zf.jcu.cz>
On Thu, 2 Dec 1999, Karel Zak - Zakkr wrote:
> > I have a table: orders (id int, val INT4[][]);. The question is how to
> > select in separate rows values from particular id?
> > example:
> > insert into orders values(1,'{{1,1},{1,4},{2,3}}');
> > select val from orders where id=1; gives me:
> > val
> > -------------------
> > {{1,2},{1,4},{2,3}}
> If I good undertend you.. You want select values from a array in separate
> rows. Hmm see:
> select o.val[1][1] from orders o where id=1 UNION ALL select o.val[1][2]
> from orders o where id=1;
> val
> ---
> 1
> 2
> (2 rows)
what i meant was:
c1 c2
1 2
1 4
2 3
how can i do this?
mazek
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: m.mazurek@multinet.pl, zakkr@zf.jcu.cz
Subject: Re: [SQL] arrays
In-Reply-To: <Pine.BSF.3.96.991202115951.14919E-100000@arka>
* 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