Re: Why is this a cross join?

Поиск
Список
Период
Сортировка
Искать
От
Alban Hertroys
Тема
Re: Why is this a cross join?
Дата
Msg-id
D7456D20-E348-4EC2-994D-709EEAD2DB40@gmail.com
Ответ на
Список
Дерево обсуждения
Why is this a cross join? Tim Uckun <timuckun@gmail.com>
Re: Why is this a cross join? Alban Hertroys <haramrae@gmail.com>
Re: Why is this a cross join? Tim Uckun <timuckun@gmail.com>
Re: Why is this a cross join? Tony Theodore <tony.theodore@gmail.com>
Re: Why is this a cross join? Tim Uckun <timuckun@gmail.com>
Re: Why is this a cross join? Kevin Grittner <kgrittn@ymail.com>
Re: Why is this a cross join? Tim Uckun <timuckun@gmail.com>
Re: Why is this a cross join? Kevin Grittner <kgrittn@ymail.com>
Re: Why is this a cross join? Adrian Klaver <adrian.klaver@gmail.com>
Re: Why is this a cross join? John R Pierce <pierce@hogranch.com>
Re: Why is this a cross join? Tony Theodore <tony.theodore@gmail.com>
On Feb 17, 2013, at 9:16, Tim Uckun  wrote:

> I have a seemingly simple query that returns way too many records.
> Here is the count query
>=20
> select count(*) from (
>    select crm.*
>    from sap_crm_sales crm
>     inner join model_configurations mc on left(crm.customer_class, 6)
> =3D left(mc.sap_code,6)
> ) as s
>=20
> The crm table has about 44K records, the model table has about 1K the
> join produces about 9 million  records


Apparently the first 6 characters of those fields are quite common, =
which gives you a result for every possible combination of the same =
6-character value.

Alban Hertroys
--
If you can't see the forest for the trees,
cut the trees and you'll find there is no forest.
В списке pgsql-general по дате отправления
От: Tim Uckun
Дата:
Сообщение: Why is this a cross join?
От: Satoshi Nagayasu
Дата:
FAQ