Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SELECT to combine master and 2 child tables
Message
 
To
10/05/2004 21:57:42
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00902663
Message ID:
00902690
Views:
26
You're correct in that VFP doesn't support sub-queries of this type. (I think VFP 9 will, but that won't be out for a while.) Here's how you need to do this:
SELECT h.pid_owner, h.ord_cod, ;
       SUM(d.itm_prcus * d.qty_ord) as OrderTotal, ;
       SUM(i.itm_prcus * i.qty_sent) as InvoiceTotal ;
   FROM C:\QN\datatmp\qn_head h ;
      INNER JOIN C:\qn\datatemp\qn_dtl d ;
         ON d.pid_owner = h.pid_owner AND d.ord_cod = h.ord_code ;
      INNER JOIN c:\qn\datatemp\qn_inv i ;
         ON i.pid_owner = h.pid_owner AND i.ord_code = h.ord_cod ;
   ORDER BY h.pid_owner, h.ord_cod
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform