Received: from unixserv.rz.fh-hannover.de (root@rzgw.rz.fh-hannover.de [141.71.1.10]) by hub.org (8.9.3/8.9.3) with SMTP id DAA52066 for ; Wed, 19 May 1999 03:02:03 -0400 (EDT) (envelope-from wilms@stud.fh-hannover.de) Received: from schering.si2.uni-hannover.de by unixserv.rz.fh-hannover.de (AIX 3.2/UCB 5.64/4.03) id AA10183; Wed, 19 May 1999 09:08:18 +0200 Sender: wilms@unixserv.rz.fh-hannover.de Message-Id: <37426096.158674B9@stud.fh-hannover.de> Date: Wed, 19 May 1999 08:56:22 +0200 From: Heiko Wilms Organization: Schering-Institut X-Mailer: Mozilla 4.5 [en] (X11; I; Linux 2.0.35 i586) X-Accept-Language: en Mime-Version: 1.0 To: pgsql-sql@hub.org Subject: query an array... Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit > Hi, > > I stucked upon the following situation: > create table test ( > n int[] ); > > insert into test values ( > > '{1,2,3,4}' > > ); > > now I need a query that returns all four numbers in different variables,i.e. > > an array like n[1],...,n[4] > > I tried queries like > > select test.n from test which returns {1,2,3,4} > > or > > select test.n[i] from test, where i is 1,2,3 or 4 which each returns 1,2,... > > What I'm looking for is a query that returns four rows with one number in each > > result index. Can anyone help? > -- H. Wilms Homepage schering.si2.uni-hannover.de/hugo email wilms@stud.fh-hannover.de