Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need help with a right join (I think?)
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00256837
Message ID:
00257066
Views:
29
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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform