SQLSERVER 是去掉重复数据

1.distinct

 select distinct name from 表 

2.group by

select name from 表 group by name

3.建立临时表 newtable 

select * into newtable
from [user] where isdel=0  select * from newtable where id in (select max(id)
from newtable group by name)
drop table newtable

原文地址:https://www.cnblogs.com/yuanye0918/p/7551512.html