Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Joining tables
Message
From
15/11/2001 12:27:12
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
15/11/2001 12:02:03
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00582131
Message ID:
00582206
Views:
28
>>Todd,
>>Make second join and 'inner' join.
>>Also moving " and child.location = 'MAIN'" to where would work but having that in join sounds better to me.
>>Cetin
>
>moving the = 'MAIN' to the where clause fixed it. It still sounds better to have it in the join condition, but at this moment, it works, I'm gonna run with it. :-)
>
>Thanks for your help and all the hard work by Vlad!
Todd,
I missed you want 'NULL' if no match (as reading your example). Try this one :

select master.*, child.altid as myfield ;
from master ;
left outer join crossref on master.id = crossref.id ;
left join child on crossref.id2 = child.id2 ;
where master.id = 2 and iif(!isnull(crossref.id), child.location = 'MAIN', .t.)

Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform