Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL suggestions needed
Message
De
14/02/2000 13:58:24
Cindy Winegarden
Duke University Medical Center
Durham, Caroline du Nord, États-Unis
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00331812
Message ID:
00331826
Vues:
20
Nadya,

Move the WHERE restrictions on the secondary tables to the join clauses like:
<b> 
INNER JOIN SiteMstr ON SiteMstr.Town = Towns.Town AND SiteMstr.Town = "GOSN"
</b>
Leave only conditions on TranMstr in the WHERE clause. The WHERE takes precedence over the join and will not return nulls to match the TranMstr records.

(I just ran into this same problem last week!!)



>I want to have this record in returning result with NULL in all fields. How can I achieve this?
>
>This is my SQL:
>
>SELECT * FROM tranmstr ;
left JOIN misclndr on tranmstr.tranid = misclndr.tranid ;
inner JOIN propmstr on tranmstr.propid = propmstr.propid ;
inner JOIN sitemstr on tranmstr.propid = sitemstr.propid ;
left JOIN bldgmstr on tranmstr.propid = bldgmstr.propid ;
<b>right join Towns on SiteMstr.Town=Towns.Town</b> ;
where (prefcode = "P" and sitemstr.town="GOSN" and SOURCE="S") ;
and between(tranmstr.extrYear+tranmstr.extrWeek ,oJC.LowWeek, oJC.HighWeek) ; INTO TABLE &qry_arg3
>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform