declare @t table(Id int, Name varchar, IsPublic bit)
insert into @t(Id, Name) values(1, 'a')
insert into @t(Id, Name) values(2, 'b')
insert into @t(Id, Name) values(3, 'b')
update a
set IsPublic = isnull( (select 0 from @t b where a.Name = b.Name and a.id > b.id), 1)
from @t a
select * from @t
Неуникальная запись с минимальным идентификатором получает IsPublic = 1