





























create table #temp(ttype varchar(50),tno int)
declare @temp_type1 varchar(50)
declare @temp_type2 varchar(50)
declare @temp_no int
declare mycursor cursor for select imagetype,imageno from imageproperty_t where archno='141227'order by imageno
open mycursor
fetch next from mycursor into @temp_type1,@temp_no
set @temp_type2=@temp_type1
insert into #temp values(@temp_type1,@temp_no)
while(@@fetch_status=0)
begin
if @temp_type1<>@temp_type2
insert into #temp values(@temp_type1,@temp_no)
set @temp_type2=@temp_type1
fetch next from mycursor into @temp_type1,@temp_no
end
close mycursor
select * from #temp order by tno
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。