【发布时间】:2021-01-26 23:49:36
【问题描述】:
我有一个如下所示的数据库表。
id account_id action time_point
3 234 delete 100
1 656 create 600
1 4435 update 900
3 645 create 50
我需要按 id 对该表进行分组,并选择 time_point 具有最大值的特定行。
结果表应如下所示:
id account_id action time_point
3 234 delete 100
1 4435 update 900
感谢您的帮助, qwew
【问题讨论】:
标签: sql postgresql sql-order-by greatest-n-per-group window-functions