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

posted on 2017-09-19 13:59  嘿呀土豆  阅读(130)  评论(0编辑  收藏  举报

导航