如何得到某条记录的排名? 想知道某条记录的排名,如何实现?架设我有 order by hits desc,我想知道其中id为123的记录已hits排名时排第几?经常用于歌手名次或专辑名次。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 这个很好做的,在while循环的时候设置一个$i;$i=1 while循环完后$i++ 这样所有的排名都会有的。 在SQL里用正常查询语句,例如select count(*) from table where id>10获得count(*)数,应该就是你说的排名了吧如果不是int索引来查找的话,可能就麻烦了 select count(*)+1 from biao where hits>(select hits from biao where id=123) select count(*)+1 from biao where hits> (select hits from biao where id=123) php的网同时在线人数超过100人以上,网站就开始打开很慢了。 Elgg SNS 翻译文件编码问题 php中_POST获取值, 不存在时,怎么验证 php上传文件类型控制 window.open 的问题,大家帮我们看看啊 Zend Studio 怎么不能够调试 iframe中如何获取父窗口中设定的iframe名称? 求php java程序员面试试题 高分求sql语句 怎么做日访量排名? php怎么调用一个类啊! PHP程序加入静态HTML报错
select count(*) from table where id>10获得count(*)数,应该就是你说的排名了吧
如果不是int索引来查找的话,可能就麻烦了
select count(*)+1 from biao where hits>(select hits from biao where
id=123)
select count(*)+1 from biao where hits> (select hits from biao where
id=123)