• Looks more like you want a subquery, not a temp table.

    Something like:

    SELECT U.actionID,
       M.CardNum,
       M.serieID,
    ...
    FROM  Upgrades U
       LEFT JOIN Media M ON U.serieID = M.serieID
       INNER JOIN (SELECT U.OldCardNum,
              M.SerieID,
              M.SerieName
           FROM  Upgrades U
              INNER JOIN Media M ON U.OldCardNum = M.CardsBegin
           ) sub ON sub.SerieID = M.SerieID;
    Where...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass