select distinct * into #t from table1
drop table table1select * into table1 from #t 
drop table #t 

解决方案 »

  1.   

    --增加辅助处理字段
    alter table table1 add id int identity
    go--删除
    delete a from table1 a 
    where exists(select * from table1 where 学号=a.学号 and 姓名=a.学号 and 性别=a.学号 and 研究方向=a.研究方向 and 导师=a.导师 and id<a.id)
    go--删除辅助处理字段
    alter table table1 drop column id
      

  2.   

    select * from table1 a where not exists(select * from table1 where 姓名=a.姓名 and 性别=a.性别 and 研究方向=a.研究方向 and  导师=a.导师 and 学号<=a.学号 group by 姓名 ) group by a.姓名