Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to change JOIN to exclude?
Message
De
15/08/2008 09:20:51
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01339003
Message ID:
01339094
Vues:
19
>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)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform