; WITH cteTableName AS( SELECT ROW_NUMBER() OVER( PARTITION BY Man_name ORDER BY Model ) RowNum, * FROM TableName)SELECT CASE WHEN RowNum > 1 THEN '' ELSE Man_name END Man_name, ModelFROM cteTableName
use tempdbgodeclare @tbl table (id int not null primary key, vc varchar(10))insert into @tbl (id, vc)select 1, 'aaa'unionselect 2, 'bbb'unionselect 3, 'aaa'unionselect 4, 'aaa'unionselect 5, 'ccc';with NotToUpdate as( select MIN(id) as id, vc from @tbl group by vc)update tset t.vc = ''from @tbl t left join NotToUpdate NTU on t.id = NTU.idwhere NTU.id is nullselect * from @tbl