Search Postgresql Archives

Re: Why is this a cross join?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Tim Uckun <timuckun@xxxxxxxxx> wrote:

> I guess I am not explaining it properly..
>
> Say I created new columns on both tables called "first_6" and
> populated them with the substrings.  If I did a inner join or a
> left join on those fields would I still get a cross join?
>
> inner join model_configurations mc on mc.first_6 = crm.first_6

As others have said, that would not change the results -- you are
getting exactly what you are requesting, but apparently not what
you want.  Can you explain what it is that you do want?  If you
have ten rows in one table with the same "first six" value, and 20
rows in the other table with that same "first six" value, how do
you want them to be matched up?  Do you want one row in the result
for every row in one of the tables?  If so, how do you want to
determine which of the matching rows in the other table to choose,
and which to ignore?

-- 
Kevin Grittner
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux