Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Need help with a right join (I think?)
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00256837
Message ID:
00257066
Vues:
31
Catlink has:
ab_id  catagory
56     animal
56     mineral
57     animal
58     animal
58     mineral
58     vegetable

catagory has:
animal
vegetable
mineral
To get what you want you can use a LEFT OUTER JOIN as in;
SELECT Catagory.Catagory, CatLink.Ab_id ;
  FROM Catagory LEFT OUTER JOIN CatLink ;
    ON Catagory.Catagory = CatLink.Catagory ;
  ORDER BY 2 ;
 INTO CURSOR MyResult

GO TOP
LOCATE FOR ab_id = 57

* Now process the records until ab_id does not = 57.
When you sue the where clause you are eliminating the records that don't have a 57 in Ab_id including those that have the null there. Don't filter in the select, rather filter after the select.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform