Information générale
Forum:
Microsoft SQL Server
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 ...
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