问题提出 先造一些测试数据以说明题目: DECLARE @TestData TABLE(ID INT,Col1 VARCHAR(20),Col2 VARCHAR(20)) INSERT INTO @TestData(ID,Col1,Col2) SELECT 1,'New','Approved' UNION ALL SELECT 2,'Approved','Commited' UNION ALL SELECT 3,'Commited','In Progress' UNION ALL SELECT…