Re: [SQL] arrays

From: Marcin Mazurek - Multinet SA - Poznan <m(dot)mazurek(at)multinet(dot)pl>
To: Karel Zak - Zakkr <zakkr(at)zf(dot)jcu(dot)cz>
Cc: pgsql-sql(at)postgreSQL(dot)org
Subject: Re: [SQL] arrays
Date: 1999-12-02 11:01:15
Message-ID: Pine.BSF.3.96.991202115951.14919E-100000@arka
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Karel Zak - Zakkr 1999-12-02 11:11:56 Re: [SQL] arrays
Previous Message Karel Zak - Zakkr 1999-12-02 10:20:00 Re: [SQL] arrays