MYSQL 实现ROWNO功能

select tt.rowno 
from( select (@rownum:=@rownum+1) as rowno, t.id  
 from news t ,(select (@rownum :=0) ) b 
 where .....) tt
 where tt.id=503
原文地址:https://www.cnblogs.com/yulouchun/p/8358004.html