• Budd - Tuesday, June 12, 2018 7:30 AM

    Nice easy Question, but again it makes me think...
    Which of these performs better, and what factors determine that?
    SELECT DISTINCT *
    FROM (VALUES (1), (2), (3), (1)) AS t1(id)
    UNION ALL
    SELECT DISTINCT *
    FROM (VALUES (4), (5))    AS t2(i

    OR THIS

    SELECT *
    FROM (VALUES (1), (2), (3), (1)) AS t1(id)
    UNION
    SELECT *
    FROM (VALUES (4), (5))    AS t2(id)d)

    sorry about the TYPO's