Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Four Table Join using same table twice.
Message
 
To
04/06/2002 12:36:41
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00664572
Message ID:
00664577
Views:
20
Try with something like this
select * 
from ( LEADS 
     left outer join SOURCE on Leads.iSourceKey=Source.iSourcePrimaryKey )
     left outer join NOTES on Leads.iNoteKey = Notes.iNotePrimaryKey
>I'm trying to build an updateable, parameterized, local view from three source tables, where one of the tables is used twice, and my (limited) SQL experience isn't enough. I've made several attempts that were wrong, including FORCE, so it's time to ask for help.
>
>LEADS iLeadPrimaryKey, iSourceKey, iNoteKey
>SOURCE iSourcePrimaryKey, iNoteKey
>NOTES iNotePrimaryKey
>
>LEADS should join SOURCE on Leads.iSourceKey=Source.iSourcePrimaryKey
>LEADS should join NOTES on Leads.iNoteKey = Notes.iNotePrimaryKey
>^ This works fine.
>NOTES should join SOURCE on Source.iNoteKey = Notes.iNotePrimaryKey
>^ Adding this gives either an empty result set, or with Notes being duplicate values, depending. It should give a different set of Notes.
Hector Correa
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform