摘要: 表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 阅读全文
posted @ 2014-03-25 20:03 堂哥 阅读(4328) 评论(1) 推荐(0) 编辑