私はあなたの問題の直接的な解決策があるとは思いませんが、私はあなたのために役立つかもしれないいくつかの回避策を行いました....
create table #table(id int,c varchar(2))
insert into #table values('1','a')
insert into #table values('1','a')
insert into #table values('2','b')
insert into #table values('2','b')
insert into #table values('3','c')
insert into #table values('3','c')
insert into #table values('4','d')
insert into #table values('5','d')
declare @table table(uid int,id int ,c varchar(2));
with tbl as (
select ROW_NUMBER() OVER(ORDER BY id DESC) AS uid ,id,c from #table
)
insert into @table select * from tbl
declare @tmpid int,@tmpuid int,@cnt int
declare tmpc cursor
for select uid,id from @table;
open tmpc
fetch next from tmpc
into @tmpuid,@tmpid
while @@FETCH_STATUS = 0
BEGIN
set @cnt = (select COUNT(id) from @table where id = @tmpid)
IF (@cnt > 1)
BEGIN
delete from @table where uid = @tmpuid
END
fetch next from tmpc
into @tmpuid,@tmpid
END
CLOSE tmpc;
DEALLOCATE tmpc;
select * from @table
drop table #table