Select ID,(@rowNum:=@rowNum+1) as RowNo From a,(Select (@rowNum :=0) ) b 转载于:https://www.cnblogs.com/peasana/p/4522476.html