--1,拿到你要的数据
select num,max(idno),max(name),...into table2 from table1
group by num
--2,在table2上加上主键(略)
--3,删除table1
drop table table1
--4,改table2为table1
sp_rename 'table2','table1'
select * from tablename a
where idno=
(
select min(idno) as idno from tablename where num=a.num
)
and NAME=(
select min(NAME) as NAME from tablename where num=a.num and idno=a.idno
)