Php 如何获得mysql中的最后一种?
嗨,我有这个mysqlPhp 如何获得mysql中的最后一种?,php,mysql,Php,Mysql,嗨,我有这个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
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).
为什么
javascript
在这个问题中被标记?@brk可能是他在is技术堆栈中使用它。为每个条目记录一个时间/日期戳不是更好吗?不是,因为我在链接中使用了更新的数量。速率和更新是否总是随着记录的增加而增加?
select max(record), rate, max(update)
from your_table
group by rate