pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Gary Chambers <gwchamb@gmail.com>
To: Stephen Belcher <sycobuny@malkier.net>
Cc: Rob Sargent <robjsargent@gmail.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Join Advice and Assistance
Date: Mon, 22 Feb 2010 17:43:22 -0500
Message-ID: <302670f21002221443r4ab62e4dk2bc61f4fa55f9a48@mail.gmail.com> (raw)
In-Reply-To: <b4651e821002220915w13f81ed4p26fb0a7126ce1fff@mail.gmail.com>
References: <302670f21002211525r65caee9et396c374a3cd64b0d@mail.gmail.com>
	<4B8211B2.6020406@gmail.com>
	<302670f21002220751h6cc363fiad449314d961fcc0@mail.gmail.com>
	<4B82B960.3060901@gmail.com>
	<b4651e821002220915w13f81ed4p26fb0a7126ce1fff@mail.gmail.com>

Stephen,

> If you want to return a single row for each user, regardless of the number
> of email addresses, you might use ARRAY() with a subquery, eg (haven't
> tested this to make sure it completely works):

Your query worked perfectly!

> Of course, this will return the addresses as a character varying[], with
> output like {user@domain.tld,user@domain.tld}, and would require some minor
> contortions to present it to users cleanly. The array_to_string function may
> help you make it easier to display the results.

Absolutely -- and thank you for the suggestion.  I'll be retrieving
the results of the query through PHP, so cleanup in the query may even
be a performance degradation.

> Hope this helps,

You and Rob Sargent have helped a great deal.  Thanks to both of you.

-- Gary Chambers

/* Nothing fancy and nothing Microsoft! */



view thread (6+ messages)

Message-ID: <302670f21002221443r4ab62e4dk2bc61f4fa55f9a48@mail.gmail.com>
Permalink:  ../302670f21002221443r4ab62e4dk2bc61f4fa55f9a48@mail.gmail.com/
Also on:    postgresql.org/message-id/302670f21002221443r4ab62e4dk2bc61f4fa55f9a48@mail.gmail.com

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: gwchamb@gmail.com, sycobuny@malkier.net, robjsargent@gmail.com
  Subject: Re: Join Advice and Assistance
  In-Reply-To: <302670f21002221443r4ab62e4dk2bc61f4fa55f9a48@mail.gmail.com>

* 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