嗨,我在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).
答案 0 :(得分:1)
select max(record), rate, max(update)
from your_table
group by rate