Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Joining tables
Message
De
15/11/2001 12:27:12
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
15/11/2001 12:02:03
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00582131
Message ID:
00582206
Vues:
29
>>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform