Re: Join Advice and Assistance

From: Gary Chambers <gwchamb(at)gmail(dot)com>
To: Rob Sargent <robjsargent(at)gmail(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Join Advice and Assistance
Date: 2010-02-22 15:51:07
Message-ID: 302670f21002220751h6cc363fiad449314d961fcc0@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Rob,

Thanks for the reply...

> If you want records for user without email addresses you will need an outer
> join on user_emailaddrs
>
> /* untested */
> select u.userId, u.lname, u.lastname ,m.startdate, a.emailaddr
> from users u
> join usermetas m on u.userid = m.userid
> left join user_emailaddrs a on m.userid = a.userid

My question was related more toward eliminating the query returning a
record for each record in the one-to-many table. I see now that I'm
going to have to aggregate the e-mail addresses in order to return a
single row. Thanks again.

-- Gary Chambers

/* Nothing fancy and nothing Microsoft! */

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Rob Sargent 2010-02-22 17:05:36 Re: Join Advice and Assistance
Previous Message Rob Sargent 2010-02-22 05:10:10 Re: Join Advice and Assistance