Received: from arka.poznan.mtl.pl (IDENT:mazek@arka.poznan.mtl.pl [195.116.164.132]) by hub.org (8.9.3/8.9.3) with ESMTP id GAA85569 for ; Thu, 2 Dec 1999 06:02:09 -0500 (EST) (envelope-from m.mazurek@multinet.pl) Received: from localhost (mazek@localhost) by arka.poznan.mtl.pl (8.9.2/8.9.2) with SMTP id MAA19715; Thu, 2 Dec 1999 12:01:15 +0100 (CET) X-Authentication-Warning: arka.poznan.mtl.pl: mazek owned process doing -bs Date: Thu, 2 Dec 1999 12:01:15 +0100 (CET) From: Marcin Mazurek - Multinet SA - Poznan X-Sender: mazek@arka To: Karel Zak - Zakkr cc: pgsql-sql@postgreSQL.org Subject: Re: [SQL] arrays In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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