Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select - SQL dilemma
Message
From
22/07/1998 09:55:52
 
 
To
21/07/1998 16:56:41
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00119839
Message ID:
00120142
Views:
22
>Thanks Dave ---
>
>
>>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform