SQLSERVER 是去掉重复数据

1.distincttable

 select distinct name from 表 select

2.group bytab

select name from 表 group by namedi

3.创建临时表 newtable new

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

相关文章
相关标签/搜索