Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SELECT to combine master and 2 child tables
Message
 
To
11/05/2004 01:50:32
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00902663
Message ID:
00902714
Views:
26
Sure you can. You can use the view designer if you're more comfortable with that, or you can do it in code like this:
CREATE DATABASE ViewsDBC

CREATE SQL VIEW OrdTots AS ;
   Select pid, SUM(...) as OrdTotal ;
      From c:\qn\datatemp... ;
      GROUP BY pid

CREATE SQL VIEW InvTots AS ;
   Select pid, SUM(...) as InvTotal ;
      FROM c:\qn\datatemp... ;
      GROUP BY PID
This will give you two non-updatable views. (If you want them updatable, you have to set a bunch of properties.)

Now that you have totals for orders and invoice by Pid, you can create your third query.
Previous
Reply
Map
View

Click here to load this message in the networking platform