Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What to use to join unrelated tables?
Message
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01139715
Message ID:
01139795
Views:
10
>>Hi everybody,
>>
>>I want to find all patients from our Live tables whose names don't match names in Stage tables. I can join based on cSSN and dDOB when both fields have data in them.
>>
>>In other words, something like:
>>select SN.cf_Name as cStage_fName, ;
>>SN.cl_Name as cStage_lName, SN.cm_Initial as cStage_mInitial, ;
>>NA.cf_Name, NA.cl_Name, NA.cm_Initial, NA.cNames_pk, PN.cSSN. PN.dDOB ;
>>from Stage_Patients inner join Stage_Names SN on ...
>>inner join Patients on ??????
>>inner join Names NA on Patients.cPatiens_pk = NA.cPointer_fk
>>.....
>>
>>I'm a little bit concerned about joining stage and life data tables. I want to join by SSN and dDOB when both have values. Should I put this into JOIN? Or I somehow can use WHERE instead?
>
>With INNER JOIN it doesn't make a difference if you put check for not empty SSN and dDOB into JOIN or WHERE.

Thanks. Now I have enough courage to start writing this select in code rather than in my head <g>
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform