Bug? Ctrl+B, Ctrl+Q assigns same alias to both parts of the JOIN

PDinCAPDinCA Posts: 635 Silver 1
Version 7.3.0.775
UPDATE uvu
               SET IncludeInVersionResult = 0
            FROM #UniqueVersions uvu
             WHERE VersionNumber <> 1
                   AND PromotionID IN ( SELECT PromotionID
                                          FROM #UniqueVersions UV
                                         WHERE UV.SlotSetID = SlotSetID
                                               AND UV.SlotNum = SlotNum
                                               AND UV.PromotionID = PromotionID
                                               AND UV.ContentID = ContentID
                                               AND UV.VersionNumber = 1
                                               AND CAST(UV.AssignedGeographies AS nvarchar(max)) <> CAST(AssignedGeographies AS nvarchar(max))
                                      );

Ends up as:
UPDATE uvu
               SET uvu.IncludeInVersionResult = 0
            FROM #UniqueVersions uvu
             WHERE VersionNumber <> 1
                   AND PromotionID IN ( SELECT UV.PromotionID
                                          FROM #UniqueVersions UV
                                         WHERE UV.SlotSetID = UV.SlotSetID
                                               AND UV.SlotNum = UV.SlotNum
                                               AND UV.PromotionID = UV.PromotionID
                                               AND UV.ContentID = UV.ContentID
                                               AND UV.VersionNumber = 1
                                               AND CAST(UV.AssignedGeographies AS nvarchar(max)) <> CAST(UV.AssignedGeographies AS nvarchar(max))
                                      );

The right-hand side qualifiers s/b uvu, not UV.
Jesus Christ: Lunatic, liar or Lord?
Decide wisely...
Tagged:

Comments

Sign In or Register to comment.