• I believe this will handle your first case:

    SELECT [col1ID]

    , CAST(CASE WHEN MIN([Col2ID]) = MAX([Col2ID]) THEN 1 ELSE 0 END AS BIT) AS [Bit]

    FROM [#Table]

    GROUP BY [col1ID]

    ORDER BY [col1ID];

    I do not understand what your business rules are for the second case.