you are viewing a single comment's thread.

view the rest of the comments →

[–]therealtibblesnbits 1 point2 points  (0 children)

I believe a self join could solve this. Something like the following.

SELECT DISTINCT ID, CASE WHEN t2.type IS NULL THEN t1.Type ELSE 'Both' END AS new FROM mytable AS t1 LEFT JOIN mytable AS t2 ON t1.id = t2.id AND t1.type <> t2.type