标签:highlight insert sts 创建 ant group by eid blog not
sql循环,除了游标还有如下
-- --创建临时表 -- DECLARE @tradeID INT; --if not object_id(‘Tempdb..#A‘) is null -- drop table #A --Create table #A([TradeID] nvarchar(100)) --Insert #A SELECT TradeID FROM dbo.CRM_AntiFakeQRec GROUP BY TradeID --WHILE EXISTS(SELECT TradeID FROM #A) --BEGIN --SET ROWCOUNT 1 --SELECT @tradeID=TradeID FROM #A --SET ROWCOUNT 0 --DELETE FROM #A WHERE TradeID=@tradeID --PRINT @tradeID
标签:highlight insert sts 创建 ant group by eid blog not
原文地址:http://www.cnblogs.com/SmilePastaLi/p/7125586.html