Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id CE5D5632B36 for ; Mon, 22 Feb 2010 18:43:34 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 47510-10 for ; Mon, 22 Feb 2010 22:43:18 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-qy0-f202.google.com (mail-qy0-f202.google.com [209.85.221.202]) by mail.postgresql.org (Postfix) with ESMTP id 2B96C6326D5 for ; Mon, 22 Feb 2010 18:43:24 -0400 (AST) Received: by qyk40 with SMTP id 40so2287289qyk.24 for ; Mon, 22 Feb 2010 14:43:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=ratHRiUPkguUsLSiXoosT3vkwIO9WkaZMiyeotBLhT8=; b=ugn3IFgx/0YOcfi6N6aAYFuQxzBumecmYl24KjmX2O6b4xbyxFySj2HZl5MSVtiqC7 GWyShsb+ewkqSVAPcQwUUZNbdlSVOVz1PahXBCoVuZ25kPHC/DpniVUDFOg5uuDvYs2T fgzmi89LpeCz+k6X09/3TI93DeB32M4YG7tTg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=vCaq7ebQlHiEdGW6U/TVgxJamGd7n/vmDY8QhEWjwIPKB78d9rP0RHNkMb/5pzYn8b 2rexRzgKImdLz4Fbso+zOfm5FdlNuzB4hnZ31ntfoHM8l6sZx274uQYxPCma/aSdVdLv IAqYYfCfwkWLSMvoNbCrItzcj6OGu63BQmr7A= MIME-Version: 1.0 Received: by 10.229.127.164 with SMTP id g36mr3661679qcs.99.1266878602922; Mon, 22 Feb 2010 14:43:22 -0800 (PST) In-Reply-To: References: <302670f21002211525r65caee9et396c374a3cd64b0d@mail.gmail.com> <4B8211B2.6020406@gmail.com> <302670f21002220751h6cc363fiad449314d961fcc0@mail.gmail.com> <4B82B960.3060901@gmail.com> Date: Mon, 22 Feb 2010 17:43:22 -0500 Message-ID: <302670f21002221443r4ab62e4dk2bc61f4fa55f9a48@mail.gmail.com> Subject: Re: Join Advice and Assistance From: Gary Chambers To: Stephen Belcher Cc: Rob Sargent , pgsql-sql@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.996 tagged_above=-10 required=5 tests=AWL=0.604, BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 201002/88 X-Sequence-Number: 33687 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! */