标签: sql-server cursor fetch union
我想用类似的代码结合具有许多参数的查询
while @@FETCH_STATUS = 0 BEGIN set @query = @query + 'select ' + @temp + ' from table_A' + char(13) + 'union' + char(13) fetch next from cur into @temp end
问题是,如何删除上一个联合?