Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL suggestions needed
Message
From
15/02/2000 09:59:33
Oleg Khvalin
The Sutherland Group Ltd
Rochester, New York, United States
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00331812
Message ID:
00332157
Views:
15
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform