Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Any ideas on speeding up this query
Message
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:
01284161
Vues:
22
>VFP 9.0 no service packs... Win XP2, Windows server 2003.
>VFP database

What that query gives to you:
SELECT Ord1.orderid,;
       Ordsize.orderprodid,;
       SUM(Ordsize.ordered)   AS totordered,;
       SUM(Ordsize.allocated) AS totallocated,;
       SUM(Ordsize.shipped)   AS totshipped,;
       Ord1.sbo               AS specialord;
 FROM Ordsize ;
 INNER JOIN (SELECT ordprod.OrderId,
                    Ordhead.sbo
             FROM ordprod
             INNER JOIN ordhead ON  Ordprod.orderid     = Ordhead.orderid;) Ord1
ON Ord1 ON Ordsize.orderprodid = Ordprod.orderprodid
GROUP BY Ordsize.orderprodid, Ord1.orderid, Ord1.sbo;
ORDER BY Ordsize.orderprodid
WHERE Ordsize.orderprodid > 0 && Assuming you have index based on Ordsize.orderprodid and Ordsize.orderprodid is always bigger than 0 (Zero)
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform