Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Any ideas on speeding up this query
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01284133
Message ID:
01284161
Views:
21
>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.
Previous
Reply
Map
View

Click here to load this message in the networking platform