pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heiko Wilms <wilms@stud.fh-hannover.de>
To: pgsql-sql@hub.org
Subject: query an array...
Date: Wed, 19 May 1999 08:56:22 +0200
Message-ID: <37426096.158674B9@stud.fh-hannover.de> (raw)

> 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






view thread (2+ messages)  latest in thread

Message-ID: <37426096.158674B9@stud.fh-hannover.de>
Permalink:  ../37426096.158674B9@stud.fh-hannover.de/
Also on:    postgresql.org/message-id/37426096.158674B9@stud.fh-hannover.de

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: wilms@stud.fh-hannover.de, pgsql-sql@hub.org
  Subject: Re: query an array...
  In-Reply-To: <37426096.158674B9@stud.fh-hannover.de>
  References: <37426096.158674B9@stud.fh-hannover.de>

* 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