How to check if value exists in each group (after group by)

You must execute the code again to save those values in the database.
uidtype1type2type3type4
Alex1111
Ben0111

(7 rows affected)

(2 rows affected)