Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL suggestions needed
Message
De
15/02/2000 09:59:33
Oleg Khvalin
The Sutherland Group Ltd
Rochester, New York, É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:
00332157
Vues:
13
Nadya,
if 2 SELECTs give you result you want (not sure I understood what you expect,
is it 1 rec per town or just 1 rec at all?)
just combine them :
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 ;
and sitemstr.town="GOSN" ;
left JOIN bldgmstr on tranmstr.propid = bldgmstr.propid ;
right join Towns on SiteMstr.Town=Towns.Town ;
where (prefcode = "P" and Towns.town="GOSN" and SOURCE="S") ;
and between(tranmstr.extrYear+tranmstr.extrWeek ,oJC.LowWeek,oJC.HighWeek) ;
INTO TABLE &qry_arg3

BTW, what about "prefcode" and "SOURCE"?
Where are they coming from?
If they belong to inner table of outer joins (like "misclndr" or "bldgmstr"), make sure you want them in WHERE clause, not in JOIN ON.
HTH
Oleg
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform