Left join, cross-joined view, running forever

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi All,

I am using VB.Net on a Pervasive.SQL database.

I am trying to retrieve all Customers and Items, and only the related Sales
for these Customers/Items. Because there isn't a link between the customer
and items, I've created a cross joined view of the customers and items, which
returns all the customers and items. I'm trying to left join specific
customer and items to Sales for a specific period; however this query is
taking forever to return my recordset.

Any ideas, for a simpler and/or more efficient solution.

Regards,

Viren
 
Unfortunately, as I stated previously, there is no link between the customer
and item table, and also I want to see all items for all customers, and the
aggregated sales for all linked customers/items, as well as zero-sales for
those that aren't linked.
 
No link ? How do you know which items a customer ordered ?
If the DB is not yours, check to see if you don't have a "link" table. Ie.
the relation is likely stored in its own table allowing a customer to order
multiple items and an item to be ordered by multiple customers...

The cross join will return all possible combinations i.e. num customers x
num items records, likely not what you want.

Patrice
--
 
Back
Top