select * into #temp1 from tblStyle where 1=2create unique index aaa on #temp1(StyleNo) with (IGNORE_DUP_KEY=ON);insert into #temp1 select * from tblStyledelete from tblStyleinsert into tblStyle select * from #temp1
樓上 eru() 第三句有問題 insert into #temp1 select StyleNo max(c2), max(c3), max(c4), max(c5) from tblStyle Group By StyleNo
第三句有問題
insert into #temp1
select StyleNo
max(c2),
max(c3),
max(c4),
max(c5)
from tblStyle
Group By StyleNo