Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement