select distinct id,name into #temp from 表名
drop table 表名
select * into 表名 from #temp
drop table #temp
麻烦了些。