SQL中为表添加排序序号 SELECT identity(INT, 1, 1) AS Rank,hotelNo,hotelName INTO #tmp FROM hotel SELECT * FROM #tmp DROP TABLE #tmp