Search Postgresql Archives

Why is this a cross join?

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

 



I have a seemingly simple query that returns way too many records.
Here is the count query

select count(*) from (
    select crm.*
    from sap_crm_sales crm
     inner join model_configurations mc on left(crm.customer_class, 6)
= left(mc.sap_code,6)
) as s

The crm table has about 44K records, the model table has about 1K the
join produces about 9 million  records

It doesn't matter if I make it a left join or inner join the count
ends up the same.


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