Re: Join query query

From: Sergey Konoplev <gray(dot)ru(at)gmail(dot)com>
To: Andrew Taylor <andydtaylor(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Join query query
Date: 2013-02-13 23:24:18
Message-ID: CAL_0b1tRjF4ZkeN3cS_2V00tXbPoQK9x1Q+rWA6dFnMz9+1e+g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Feb 13, 2013 at 3:01 PM, Andrew Taylor <andydtaylor(at)gmail(dot)com> wrote:
> And ended up with a table 13,708,233 rows long with what looks like plenty
> of duplicated rows. Some but not all are duplicated. What can I do to sort
> this out?

It means that (e, n) pairs are not unique in A and B and you got a
superposition of them. If you have 5 equal pairs in A and 7 same pairs
with in B you will get 35 combinations as a result.

And BTW when you use LEFT JOIN if there are rows in A that have no
matching pairs in B you will get one row for each of them where lan
and lon are NULLs.

See the join_type section here
http://www.postgresql.org/docs/9.2/static/sql-select.html.

--
Sergey Konoplev
Database and Software Architect
http://www.linkedin.com/in/grayhemp

Phones:
USA +1 415 867 9984
Russia, Moscow +7 901 903 0499
Russia, Krasnodar +7 988 888 1979

Skype: gray-hemp
Jabber: gray(dot)ru(at)gmail(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jeff Janes 2013-02-13 23:31:32 Re: Runtime variations during day
Previous Message Carlos Henrique Reimer 2013-02-13 23:09:55 Re: Runtime variations during day