Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to change JOIN to exclude?
Message
From
15/08/2008 09:20:51
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01339003
Message ID:
01339094
Views:
18
>But the value in MyTable2.fld1 is not NULL. It has some entry but the entry has not corresponding value in MyTable1.
>
>Thank you.

NULL values can come from the original table, but they can also be added by a query, specifically in an outer join, if there is no corresponding value in one of the tables. This can be used - as in the examples you have been given - to either include or exclude data that has no match.

To convert the NULL data to something different, use NVL(). In VFP 9, I would also use CAST to enforce a certain field type and size.

For example, if the data is of type Currency:
select ... nvl(Amount, $0) as Amount
No cast() is necessary in this case, since $0 will ensure the correct type.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform