创建临时表 #Test CREATE TABLE #Test( ID INT, Name VARCHAR(50) ) INSERT INTO #Test( ID, Name ) VALUES ( 1, 'A' ) INSERT INTO #Test( ID, Name ) VALUES ( 2, 'A' ) INSERT INTO #Test( ID, Name ) VALUES ( 4, 'A' ) INSERT INTO #Test( ID, Name ) VALUES ( 5, 'B' )…