摘要:
表test中现有数据idscore11025315执行sqlselect id,score,(@rowno:=@rowno+1) as rowno from test,(select (@rowno:=0)) b order by score desc; 获得如下结果idscorerowno31511102253然后在此基础上查询某条记录的位置select rowno from (select id,score,(@rowno:=@rowno+1) as rowno from test,(select (@rowno:=0)) b order by score desc) c where id 阅读全文