Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Left Outer Join
Message
From
09/03/1999 09:03:11
 
 
To
09/03/1999 08:22:59
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Title:
Miscellaneous
Thread ID:
00195480
Message ID:
00195489
Views:
15
>Hi there. I've been outsourced and the data over here is not in that great a shape. I've found that things that should have a one to many relationship, some of the many's are there, but the one is gone (i.e., inventory entries that have no corresponding items table entry). It's really fun :).
>
>Anyway, to play it safe I've decided that I need to use a left outer join and a bit more logic for everything I create, just to cover my butt. I was going to write a routine to do that (since archaic 2.6 doesn't have it to the best of my knowledge :) ) but I thought I'd ask if anyone out here has done something like that already.
>
>Thanks!

Hi Denise,

Most people simulate an Outer Join using the UNION clause, I.e. the main select performs the Inner Join and the UNION adds the records left out from the Inner Join. If I remember correctly ( it's been awhile sincce I did one of these ), the typical syntax is usually something like:

SELECT ... ( your Inner Join parameters );
UNION SELECT ... WHERE YourKey NOT IN ( SELECT YourKey FROM ... )

You might need to play with the parameters and syntax to get it right, or someone else may remember the exact syntax for the UNION.

Bill
William A. Caton III
Software Engineer
MAXIMUS
Atlanta, Ga.
Previous
Reply
Map
View

Click here to load this message in the networking platform