Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Joining tables
Message
From
15/11/2001 11:15:22
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Joining tables
Miscellaneous
Thread ID:
00582131
Message ID:
00582131
Views:
58
I have the typical master, crossref, child set up. I'm trying to retrieve a particular child record, and having trouble.

My master record links to 4 crossref records, which each link to 1 child record. I need to pull the child record with the location field of "MAIN"
select master.*, child.altid as myfield ;
from master ;
left outer join crossref on master.id = crossref.id ;
left outer join child on crossref.id2 = child.id2 and child.location = 'MAIN' ;
where master.id = '1'
The problem is that this creates 4 records in the result set -- and I only expect 1. I've simplified the problem a bit -- I have a feeling that there is a nuance of SQL syntax I'm missing. This select is going to end up in a veiw that I am using for reporting. If all else fails, I'll make seperate views and link em together with set relation -- I know that works ;-)
--Todd Sherman
-Wake Up! Smell the Coffee!
Next
Reply
Map
View

Click here to load this message in the networking platform