되도록이면 한방쿼리 하지만 그게 더 귀찬을때가..(처리를 구현하는 사고 방식의 전환)
declare @tmptable table( A int identity(1,1) not null, B int not null, C int not null )insert @tmptable (B,C) select B,C from CONTENT_TABLE where B in(1,5,10,50,100,200,300,400,500,600,700,800,900,1000) and X = 'WHAT' declare @i int,@maxcounter int declare @B int declare @C int set @i = 0;select @maxcounter = count(*) from @tmptable while @i < @maxcounterbegin set @i = @i+1 select @B = B,@C = C ..