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

相關文章
相關標籤/搜索