gpt4 book ai didi

php - 如何获取mysql中的最后一个同类?

转载 作者:行者123 更新时间:2023-11-29 10:15:50 25 4
gpt4 key购买 nike

你好,我在 mysql 中有这个。

record rate update
1 1 1
2 1 2
3 1 3
4 1 4
5 2 1
6 2 2
7 3 1
8 3 2
9 3 3

我想选择每个费率最后更新的行。

例如:

the last row of rate 1 is (4 1 4),     
the last row of rate 2 is (6 2 2)
and the last row of rate 3 is (9 3 3).

最佳答案

select max(record), rate, max(update)
from your_table
group by rate

关于php - 如何获取mysql中的最后一个同类?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50127493/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com