Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Table Join
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Miscellaneous
Thread ID:
00669751
Message ID:
00669854
Views:
19
Why not try the query in two parts. Do the first 2 inner joins and then union it to the third.

FROM holding thold
inner join security
on thold.securityid = security.securityid
inner join portfolio
on thold.portid = portfolio.portid
WHERE thold.date = @asofdate
union ( select ... from holding
left join holding yhold
on (thold.portid = yhold.portid and thold.securityid = yold.securityid
WHERE yhold.date = @prevdate)
into ...
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform