当前位置:网站首页>Ranking of data results in MySQL
Ranking of data results in MySQL
2022-07-25 09:19:00 【Why don't you laugh】
such as : Query the user's points , After salary data , Attach a ranking attribute value
If you need to add other query criteria , For example, the same score can be in chronological order
SELECT
a.*,
@rank := @rank + 1 AS rankNo
FROM
(
SELECT
userinfo_id AS userid,
userinfo_name AS nickname,
SUM( score ) AS score
FROM
my_point
GROUP BY
userinfo_id
ORDER BY
score DESC
) a,
( SELECT @rank := 0 ) b
After operation , We will get the following results , According to the descending order of points and corresponding ranking 
Add later ..
边栏推荐
- ActiveMQ -- kahadb of persistent mechanism
- The hole of scroll view in uniapp
- js小游戏源码魔塔闯关下载
- Ten thousand words long, one word thoroughly! Finally, someone has made business intelligence (BI) clear
- Learn about spark project on Nebula graph
- Rich text style word image processing
- 超赞的yolo目标检测训练所用垃圾分类数据集共享——标注好的约3000张
- activemq--可持久化机制
- Software examination system architecture designer concise tutorial | software life cycle
- uniapp中scroll-view的坑
猜你喜欢

LabVIEW experiment - temperature detection system (experimental learning version)

Robot jumping problem

51 single chip microcomputer key control LED light status

Ctfhub skill tree Web

这家十年内容产业基建公司,竟是隐形的Web3先行者

JS small game source code magic tower breakthrough Download

Solve the syntaxerror: unexpected end of JSON input

Sort out Huawei ap-3010dn_ V2 configuration create WiFi

Shell脚本

Uniapp intercepts route jumps through addinterceptor to control whether the page needs to log in
随机推荐
360度拖拽全景图插件tpanorama.js
富文本样式文字图片处理
Collection of common algorithm questions in test post interview
OpenCV实现简单的人脸追踪
28. Slot
OmniPeek packet capturing tool
[C language] dynamic memory management, flexible array
2022-7-14 JMeter pressure test
activemq--可持久化机制
对称式加密与非对称式加密的对比
Solve the syntaxerror: unexpected end of JSON input
flink sql怎么持久化?
The development of art NFT
Nacos搭建配置中心出现client error: invalid param. endpoint is blank
What are the commands used by pl/sql tools to export SQL files?
Arcgis10.2 installation tutorial
[SCADA case] myscada helps VIB company realize the modernization and upgrading of production line
js弹出式城市筛选组件匹配手机移动端
Redis sentry, master-slave deployment details
(self drawn ugly picture) simple understanding tcp/ip three handshakes and four waves