select row_number() over(order by t.id ) as num,id,name from (SELECT distinct [列 0] as id ,[列 1] as name FROM MonitorSetup --order by [列 0] )t