• I notice that you're looking for multiple seasons for same ID

    I.e. If ID has both Season16 and Season 15 then Flag is 0 else 1.

    Since row with id = 3 has both records as "Season 15", you want the flag to be "1"

    Slight modification to Phil's answer. Including "distinct" on the count would be required.

    SELECT t.Id

    , Flag = IIF(COUNT( distinct value) > 1, 0, 1)

    FROM #test t

    GROUP BY t.Id;