Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
3 Table SQL Join
Message
 
 
To
08/12/1999 14:11:01
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00300033
Message ID:
00300538
Views:
23
Based on the code you gave to create the 3 tables and insert the test data, the following returned the exact 5 records you wanted:
select TableA.*, TableB.*, TableC.*;
  from TableA ;
  Left Join TableB ;
  on TableA.Ident = TableB.Ident ;
  and TableA.FKey = TableB.FKey ;
  Left Join TableC ;
  on TableA.Ident = TableC.Ident ;
  having (isnull(TableB.FiltB) or TableB.FiltB = 1) ;
  and (isnull(TableC.FiltC) or TableC.FiltC = 1)
Mark McCasland
Midlothian, TX USA
Previous
Reply
Map
View

Click here to load this message in the networking platform