Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL suggestions needed
Message
From
14/02/2000 13:58:24
Cindy Winegarden
Duke University Medical Center
Durham, North Carolina, United States
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00331812
Message ID:
00331826
Views:
24
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
>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform