Re: [SQL] arrays - Mailing list pgsql-sql

From Marcin Mazurek - Multinet SA - Poznan
Subject Re: [SQL] arrays
Date
Msg-id Pine.BSF.3.96.991202115951.14919E-100000@arka
Whole thread Raw
In response to Re: [SQL] arrays  (Karel Zak - Zakkr <zakkr@zf.jcu.cz>)
Responses Re: [SQL] arrays
List 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



pgsql-sql by date:

Previous
From: Karel Zak - Zakkr
Date:
Subject: Re: [SQL] arrays
Next
From: Karel Zak - Zakkr
Date:
Subject: Re: [SQL] arrays