Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Any ideas on speeding up this query
Message
From
22/01/2008 13:46:48
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01284133
Message ID:
01284183
Views:
12
Also try
SELECT Ordprod.orderid, Ordsize.orderprodid,;
  Count(Ordsize.ordered) AS cntordered,;
  SUM(Ordsize.ordered) AS totordered,;
  SUM(Ordsize.allocated) AS totallocated,;
  SUM(Ordsize.shipped) AS totshipped, Ordhead.sbo AS specialord;
 FROM  Ordsize ;
    INNER JOIN ordprod ON  Ordprod.orderprodid = Ordsize.orderprodid ;
    INNER JOIN ordhead ON  Ordprod.orderid = Ordhead.orderid;
 GROUP BY 2, 1, 7;
 ORDER BY Ordsize.orderprodid
As I read about the cartesian interpretation<g>.

If faced with cartesian joins (sometimes the engine does things I cannot fathom) it helps to build each query step as a single Join or aggregate operation.

HTH

thomas
Previous
Reply
Map
View

Click here to load this message in the networking platform