(select distinct scoremysql语句顺序
from scores
order by score desc) as T1,(select @rownum:=0) as R
其结果如下:
通配符是什么具体
score1 rownum
4.00 1.0
3.85 2.0
3.65 3.0
3.50
4.0
3、与Scores表(即原表)联结
到这⾥,只要对Scores表降序排列,再与步骤2得到的T2表联结就可以了。代码如下:select wnum as Rank
from Scores
join
(select T1.score as score1,(@rownum:=@rownum+1) as rownumbmob论坛源码
from
(select distinct score
from scores
order by score desc) as T1,(select @rownum:=0) as R) as T2
on Scores.score=T2.score1
order by Scores.score DESC
视图的作用域结果如下:
Score Rank
4.00 1.0
4.00 1.0
3.85 2.0
3.65 3.0abstract和interface
12306数据库设计3.65 3.0
3.50
4.0
以上。

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。