遇事不決先上代碼(Talk is cheap, so so so ... show you CODE~)
select distinct id,(@rownum:=@rownum+1) as rownum
from exam,(select @rownum:=0) R
WHERE type = 2
order by create_time desc, update_time desc;
PS:突然忘了當時要做什么操作择示,所以備注了【雞肋】淘钟,如果有小伙伴使用了類似SQL語句并覺得使用場景很貼合喇聊,請分享一下戒洼,一起討論哈