我有一个提要应用程序,我正在尝试对结果进行连续分组。我的表如下所示:
postid | posttype | target | action | date | title | content
1 | userid | NULL | upgrade | 0000-01-00 00:00:00 | Upgraded 1 | exmple
1 | userid | NULL | upgrade | 0000-01-00 00:00:01 | Upgraded 2 | exmple
1 | userid | NULL | downgrade | 0000-01-00 00:00:02 | Downgraded | exmple
1 | userid | NULL | upgrade | 0000-01-00 00:00:03 | Upgraded | exmple
我希望的结果是:
postid | posttype | target | action | date | title | content
1 | userid | NULL | upgrade | 0000-01-00 00:00:01 | Upgrade 1 | exmple,exmple
1 | userid | NULL | downgrade | 0000-01-00 00:00:02 | Downgraded | exmple
1 | userid | NULL | upgrade | 0000-01-00 00:00:03 | Upgraded | exmple
如您所见,因为升级 1 和升级 2 是连续发送的,所以它将它们组合在一起。“Action”表是一个参考,应该用于连续分组以及 postid 和 posttype。
我环顾四周,但没有看到任何像我这样的东西。提前感谢您的帮助。