Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select - SQL dilemma
Message
De
23/07/1998 13:30:50
 
 
À
22/07/1998 09:55:52
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00119839
Message ID:
00120586
Vues:
22
JC --

You were right. Typo on my part. What I described was an OUTER but for some reason I typed INNER. Whoops.

>>
>>>does the 'master record' have to have all 3 fields filled?
>>
>>Ahhh..you see, that is the reason why I have to use LEFT INNER JOINs. A master record may not have values for the three codes and the three codes may not have matching code table records. I was willing to accept NULLs for code table values but not block out records from master. This is why I couldn't go with the default SELECT as you have outlined below. Thanks for your help anyway.
>>
>>
>>>select S.status_desc, E.emp_desc, R.res_desc from ;
>>>    master_table M, status S, employee E, resolution R where ;
>>>    M.status_code = S.status_code and ;
>>>    M.emp_code    = E.emp_code    and ;
>>>    M.res_code    = R.res_code into cursor does_this_work
>>>
>
>If you need all records from master table, then LEFT OUTER is appropriate. The SELECT statement above gives you a LEFT INNER. This is where most of the confusion lies when trying to use the newer JOIN syntax (well, relatively new). A normal SELECT a.*, b.* FROM xx a, yy b WHERE a.x1=b.y1 implies left inner.
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform