Search Postgresql Archives

Re: Why is this a cross join?

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

 



On 2/17/2013 2:09 PM, Tim Uckun wrote:
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

without additional filtering, that will return a row for every row in crm that matches a row in mc. if there's a 1000 rows in crm that each match an average of 6 rows in mc, that would return 6000 rows.

crm left join mc would return all of those, plus all the rows in crm that don't have any match in mc (the mc.* fields would be NULL in these result rows).



--
john r pierce                                      37N 122W
somewhere on the middle of the left coast



--
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