Re: Join query query - Mailing list pgsql-general

From Sergey Konoplev
Subject Re: Join query query
Date
Msg-id CAL_0b1tRjF4ZkeN3cS_2V00tXbPoQK9x1Q+rWA6dFnMz9+1e+g@mail.gmail.com
Whole thread Raw
In response to Join query query  (Andrew Taylor <andydtaylor@gmail.com>)
List pgsql-general
On Wed, Feb 13, 2013 at 3:01 PM, Andrew Taylor <andydtaylor@gmail.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.ru@gmail.com

pgsql-general by date:

Previous
From: Carlos Henrique Reimer
Date:
Subject: Re: Runtime variations during day
Next
From: Jeff Janes
Date:
Subject: Re: Runtime variations during day