select 字段1,min(字段2),min(字段3),min(字段4) from 表1 group by 字段1
alter table yourtablename add id int identity(1,1)delete from yourtablename a (select 字段1,min(id) from yourtablename where 字段1 in (select 字段1 from yourtablenam group by 字段1) group by 字段1) b where a.字段1=b.字段1 and a.id=b.idalter table yourtablename drop id
重要改正: alter table yourtablename add id int identity(1,1)select a.* from yourtablename a (select 字段1,min(id) from yourtablename where 字段1 in (select 字段1 from yourtablenam group by 字段1) group by 字段1) b where a.字段1=b.字段1 and a.id=b.idalter table yourtablename drop id
(select 字段1,min(id) from yourtablename where 字段1 in (select 字段1 from yourtablenam group by 字段1)
group by 字段1) b
where a.字段1=b.字段1 and a.id=b.idalter table yourtablename drop id
alter table yourtablename add id int identity(1,1)select a.* from yourtablename a
(select 字段1,min(id) from yourtablename where 字段1 in (select 字段1 from yourtablenam group by 字段1)
group by 字段1) b
where a.字段1=b.字段1 and a.id=b.idalter table yourtablename drop id