Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Understanding LEFT JOIN
Message
 
 
À
23/08/2005 11:16:04
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 8 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01042886
Message ID:
01042959
Vues:
37
>>Well, of course I used the last syntax, e.g. I'm not THAT dump < g >. But I still fail to see the difference, though yours avoid using NULL and therefore more elegant.
>
>
>I apologize a lot!
>But you should be more precise when you say that it doesn't work
>When it doesn't work, that results you get ?
>
>Elegant is a side effect.
>
>Can Viscodes.ccategory_description to be NULL ?
>
>A example where the two syntaxes are different:
>
>CREATE CURSOR T1 (AA I,BB I NULL)
>INSERT INTO T1 VALUES (1,4)
>INSERT INTO T1 VALUES (2,NULL)
>INSERT INTO T1 VALUES (2,NULL)
>
>SELECT * FROM T1 LEFT JOIN T1 T2 ON T2.AA=T1.AA;
>WHERE T2.BB=4 OR T2.BB IS NULL
>
>SELECT * FROM T1 LEFT JOIN T1 T2 ON T2.AA=T1.AA;
>AND T2.BB=4
>
>
>Except special cases,
>it never needs to use WHERE outertable.field IS NULL
>in a Left join on a outerfield that is not key primary

Interesting, thanks a lot.

In VisCodes, AFAIK, we don't have NULL in cCategory_Description. We were trying on my colleague computer the query with NULL. It brought records correctly, but for the code 0009 it didn't bring the records. I was looking in dis-belief, but haven't looked closely in VisCodes table for this code.

Anyway, we switched to your query and it works.

My new problem is comboboxes. Did you see my new thread? No one replied so far, so I take it as there is no way to control.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform