SELECT
b.*, (@c :=@c + 1) as rank
from (
SELECT
x, y, z
FROM
table1
WHERE
xxxxx
GROUP BY
x, y, z
) b,
(select @c := 0 ) c
ORDER BY b.x desc;
mysql中一个倒序排列的sql语句
阅读 249
2022-09-06
SELECT
b.*, (@c :=@c + 1) as rank
from (
SELECT
x, y, z
FROM
table1
WHERE
xxxxx
GROUP BY
x, y, z
) b,
(select @c := 0 ) c
ORDER BY b.x desc;
相关推荐
精彩评论(0)