如何得到某条记录的排名? 想知道某条记录的排名,如何实现?架设我有 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) 输出图片乱码?求解答 swfupload怎么获取文件的原始名称 mysql_query 出问题了 传递POST值后再抓取网页.急急急 100分 ====== 怎么比较两个中文字符串是否相等 ========== 高分求一个上传文件的php代码!谢谢!!! 如何将表单填写好后直接发送到指定邮箱? PHP+MYSQL高手们请进!~ 有在win32下成功使用xslt和xml处理的吗? 两个下拉列表问题 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)