Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem writing SQL with *ANSI nested structure*
Message
De
19/09/2000 14:05:14
 
 
À
19/09/2000 13:59:33
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00418176
Message ID:
00418180
Vues:
28
>I have no problem with writing the SQL *sequential style* as follows:
>
>SELECT e.id, e.fname, e.lname, v.vegetable, f.fruit ;
> FROM employee e ;
> LEFT OUTER JOIN vegies v on e.id = v.id ;
> LEFT OUTER JOIN fruits f on e.id = f.id ;
>
>The result has all three employees with a value for vegetable, fruit or both. My problem is trying to write it in ANSI style or trying to duplicate the above result in the Query Builder. I don't get the same result for Employee 3 who has a record in Vegies - the result for him is NULL in the vegetable column.
>
>SELECT Employee.*, Fruits.fruit, Vegies.vegetable;
> FROM employee LEFT OUTER JOIN fruits;
> LEFT OUTER JOIN vegies ;
> ON Fruits.id = Vegies.id ;
> ON Employee.id = Fruits.id
>
>What am I doing wrong?
>TIA

You're using the Query Builder. The Query Builder or View Designer suck. <g>

They do not use the sequential join syntax, only the nested join syntax.
Insanity: Doing the same thing over and over and expecting different results.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform