Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Any ideas on speeding up this query
Message
De
22/01/2008 13:46:48
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01284133
Message ID:
01284183
Vues:
13
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform