--W01中每组GB011的最小ID放到表#TEMP中
select min(ID) as ID into #TEMP from W01 Group by GB011;
--修改W01,将W01中有但是#TEMP中没有的ID,GB011改为null
update W01
set GB011= null
where ID not in (select ID from #TEMP);
--删除表#TEMP
drop table #TEMP;
--删除列ID
alter table W01 drop column ID;
其实就是把每一组GB011中非最小ID的行GB011改为空