Home > Database > Mysql Tutorial > Mysql:把指定数据行排在前方

Mysql:把指定数据行排在前方

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 16:26:56
Original
1774 people have browsed it

Mysql:把指定数据行排在前面 如果只是一条数据行,可以这样: SELECT * FROM user ORDER BY user_id7,score DESC; 主要是“user_id7”,就会把用户id为7的排在前面。 如果是多条数据行: SELECT * FROM user ORDER BY user_id NOT IN(7,8,9),score DESC;

Mysql:把指定数据行排在前面

如果只是一条数据行,可以这样:

SELECT * FROM user ORDER BY user_id7,score DESC;
Copy after login

主要是“user_id7”,就会把用户id为7的排在前面。


如果是多条数据行:

SELECT * FROM user ORDER BY user_id NOT IN(7,8,9),score DESC;
Copy after login


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
MySQL stops process
From 1970-01-01 08:00:00
0
0
0
Error when installing mysql on linux
From 1970-01-01 08:00:00
0
0
0
phpstudy cannot start mysql?
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template