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'
给我分嚓

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Event processing library in PHP8.0: Event With the continuous development of the Internet, PHP, as a popular back-end programming language, is widely used in the development of various Web applications. In this process, the event-driven mechanism has become a very important part. The event processing library Event in PHP8.0 will provide us with a more efficient and flexible event processing method. What is event handling? Event handling is a very important concept in the development of web applications. Events can be any kind of user row

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

The function of the rank function is to rank the data; the rank function is one of the basic functions of Excel and can return the ranking of the specified field value in the result set partition. The ranking of the specified field value is the ranking before the relevant row plus one. The syntax is: "RANK(number,ref,[order])".

Pygame's Event module Event (Event) is one of the important modules of Pygame. It is the core of building the entire game program, such as commonly used mouse clicks, keyboard taps, game window movement, window resizing, triggering specific plots, and exiting. Games, etc., these can be regarded as "events". Event type Pygame defines a structure specifically used to process events, namely the event queue. This structure follows the basic principle of "first come, first processed" in the queue. Through the event queue, we can process user operations in an orderly and one-by-one manner ( trigger event). The following table lists the commonly used game events in Pygame: Name Description QUIT The user presses the close button of the window ATIVEEVENTPy

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

Background exam batch class name Chinese 202302 Class 1, Class 3, Zhang Xiaoming 130.00202302 Class 3, Class 1 Wang Erxiao 128.00202302 Class 3, Class 1 Xie Chunhua 136.00202302 Class 3, Class 2 Feng Shijie 129.00202302 Class 3, Class 2 Ma Gongcheng 130.00202302 Class 3, Class 2 Wei Pianpian 136.00 Suppose we With the above data, there is now a need to count the ranking of each student's Chinese subject score in the class and the ranking of the whole year. How will you achieve it? It is easy for us to think of rank()over(). Over() is an analytical function and can be used in conjunction with rank(), dense_rank(), and row_number().

Use the window.outerWidth and window.outerHeight events to get the window size in JavaScript when the browser resizes. Example You can try running the following code to check the browser window size using events −<!DOCTYPEhtml><html> <head> <script>&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
