찾다
백엔드 개발PHP 튜토리얼MYSQL 排名排序有关问题

MYSQL 排名排序问题
SELECT sum( `yb2000_event_point` ) , `yb2000_event_phone`, `yb2000_event_riqi` FROM yb2000_event WHERE yb2000_event_riqi LIKE '%2012%' GROUP BY yb2000_event_phone order by sum( `yb2000_event_point` ) desc 

用这语句查出来了 用户的一年积分总排行 可是我想加个 条件 查出来某人的 积分数和排行 可是排行没法取 个位 大师 请教下

------解决方案--------------------
SET @rank =0;
select * from (SELECT @rank := @rank +1 AS rank, yb2000_event_phone, yb2000_event_point,user_id
FROM yb2000_event
GROUP BY yb2000_event_phone
ORDER BY yb2000_event_point)a where a.user_id='user_id'
给我分嚓

성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
PHP8.0中的事件处理库:EventPHP8.0中的事件处理库:EventMay 14, 2023 pm 05:40 PM

PHP8.0中的事件处理库:Event随着互联网的不断发展,PHP作为一门流行的后台编程语言,被广泛应用于各种Web应用程序的开发中。在这个过程中,事件驱动机制成为了非常重要的一环。PHP8.0中的事件处理库Event将为我们提供一个更加高效和灵活的事件处理方式。什么是事件处理在Web应用程序的开发中,事件处理是一个非常重要的概念。事件可以是任何一种用户行

Steam Summer Sale - Valve teases 95% off AAA games, confirms discounts for viral games Palworld and Content WarningSteam Summer Sale - Valve teases 95% off AAA games, confirms discounts for viral games Palworld and Content WarningJun 26, 2024 pm 03:40 PM

Steam's Summer Sale has previously played host to some of the best game discounts, and this year seems to be stacking up for another home run by Valve. A trailer (watch below) teasing some of the Steam Summer Sale discounted games was just released i

rank函数的功能是什么rank函数的功能是什么Jul 18, 2022 pm 03:20 PM

rank函数的功能是对数据进行排位;rank函数是Excel的基础函数之一,能够返回结果集分区内指定字段值的排名,指定字段的值的排名是相关行之前的排名加一,语法为“RANK(number,ref,[order])”。

Python之Pygame的Event事件模块怎么使用Python之Pygame的Event事件模块怎么使用May 18, 2023 am 11:58 AM

Pygame的Event事件模块事件(Event)是Pygame的重要模块之一,它是构建整个游戏程序的核心,比如常用的鼠标点击、键盘敲击、游戏窗口移动、调整窗口大小、触发特定的情节、退出游戏等,这些都可以看做是“事件”。事件类型Pygame定义了一个专门用来处理事件的结构,即事件队列,该结构遵循遵循队列“先到先处理”的基本原则,通过事件队列,我们可以有序的、逐一的处理用户的操作(触发事件)。下述表格列出了Pygame中常用的游戏事件:名称说明QUIT用户按下窗口的关闭按钮ATIVEEVENTPy

Steam Summer Sale trailer teases 95% off AAA game deals, confirms price cuts for Palworld, Stellaris, Content WarningSteam Summer Sale trailer teases 95% off AAA game deals, confirms price cuts for Palworld, Stellaris, Content WarningJun 26, 2024 am 06:30 AM

Steam's Summer Sale has previously played host to some of the best game discounts, and this year seems to be stacking up for another home run by Valve. A trailer (watch below) teasing some of the Steam Summer Sale discounted games was just released i

Java怎么模拟rank/over函数实现获取分组排名Java怎么模拟rank/over函数实现获取分组排名May 03, 2023 pm 01:52 PM

背景考试批次班级姓名语文202302三年一班张小明130.00202302三年一班王二小128.00202302三年一班谢春花136.00202302三年二班冯世杰129.00202302三年二班马功成130.00202302三年二班魏翩翩136.00假设我们有如上数据,现在有一个需求需要统计各学生语文单科成绩在班级中的排名和全年段排名,你会如何实现?很容易的我们想到了rank()over()实现over()是分析函数,可以和rank()、dense_rank()、row_number()配合使

Tesla sends out Robotaxi invitations for October 10 autonomous driving demo event in LATesla sends out Robotaxi invitations for October 10 autonomous driving demo event in LASep 27, 2024 am 06:20 AM

It was initially expected that Tesla would unveil its previously leaked Robotaxi back in August of this year, but CEO Elon Musk postponed the event, citing aesthetic changes to the front of the robotaxi and additional time needed for a few last-minut

在JavaScript中,当浏览器窗口调整大小时,这是哪个事件?在JavaScript中,当浏览器窗口调整大小时,这是哪个事件?Sep 05, 2023 am 11:25 AM

使用window.outerWidth和window.outerHeight事件在JavaScript中获取窗口大小,当浏览器调整大小时。示例您可以尝试运行以下代码来使用事件检查浏览器窗口大小−<!DOCTYPEhtml><html>  <head>   <script>&am

See all articles

핫 AI 도구

Undresser.AI Undress

Undresser.AI Undress

사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover

AI Clothes Remover

사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool

Undress AI Tool

무료로 이미지를 벗다

Clothoff.io

Clothoff.io

AI 옷 제거제

AI Hentai Generator

AI Hentai Generator

AI Hentai를 무료로 생성하십시오.

뜨거운 도구

안전한 시험 브라우저

안전한 시험 브라우저

안전한 시험 브라우저는 온라인 시험을 안전하게 치르기 위한 보안 브라우저 환경입니다. 이 소프트웨어는 모든 컴퓨터를 안전한 워크스테이션으로 바꿔줍니다. 이는 모든 유틸리티에 대한 액세스를 제어하고 학생들이 승인되지 않은 리소스를 사용하는 것을 방지합니다.

ZendStudio 13.5.1 맥

ZendStudio 13.5.1 맥

강력한 PHP 통합 개발 환경

SublimeText3 영어 버전

SublimeText3 영어 버전

권장 사항: Win 버전, 코드 프롬프트 지원!

스튜디오 13.0.1 보내기

스튜디오 13.0.1 보내기

강력한 PHP 통합 개발 환경

드림위버 CS6

드림위버 CS6

시각적 웹 개발 도구