Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What's wrong with SQL in VFP8.0?
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00800321
Message ID:
00800407
Views:
25
>That doesn't solve the problem.
>
>Imagine two tables...
>
>Table A has two records, record 1 has ID = 123 and record 2 has ID = 124. Then table B, record 1 has value 124.
>
>If I do
>
>Select *;
>From A Full Join B;
>On A.ID = B.ID;
>Where A.ID <> B.ID
>
>In 6.0 it will return ID=123 but in 7.0 OR 8.0 it will not return any records.

Ah. The problem is that when you do a comparison involving NULL, the result is NULL. If you take the WHERE clause out, and go to the row with the null, you see the following behavior.
? a.id = b.id && NULL
? a.id <> b.id && NULL
So, since equals and not-equals return the same results, what are you supposed to do? I think VFP7+ correctly leave out that ambigous row. If you want the behavior you expect, try the following.
SELECT * ;
FROM crsrA ;
   FULL JOIN crsrB ON crsrA.ID = crsrB.ID ;
HAVING ISNULL(crsrA.ID) OR ISNULL(crsrB.ID)
My blog
My consulting page
My home page

Member of the Trim Your Auto-Quote Campaign!
What's another word for thesaurus?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform