Re: selecting from integer[]

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Kelly <quadratini(at)sni(dot)ph>
Cc: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: selecting from integer[]
Date: 2002-06-29 21:11:19
Message-ID: 20020629140955.L51866-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Sat, 29 Jun 2002, Kelly wrote:

> select * from pg_user where usesysid=(select grolist[1] from pg_group
> where groname='mygroup');
> select * from pg_user where usesysid=(select grolist[2] from pg_group
> where groname='mygroup');
> select * from pg_user where usesysid=(select grolist[3] from pg_group
> where groname='mygroup');
>
> Can those three queries be merged to one query? (and still gives me
> those three rows)
> Or do I have to explicitly say grolist[1], grolist[2], etc....

If you want to do "is element in array," I believe the array iterator
functions in contrib/array might help you.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Ferenc Engard 2002-06-30 23:43:29 pl/pgsql capabilities?
Previous Message Christopher Kings-Lynne 2002-06-29 14:32:02 Re: selecting from integer[]