Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
3 Table SQL Join
Message
 
 
À
08/12/1999 14:11:01
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00300033
Message ID:
00300538
Vues:
24
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform