如何在 Postgres 中对不匹配条件的数据进行分组
I am trying to group data using Postgres.
Input Data:
My expectation result IF the output is 0, it will grouping with others, and IF output more than 0, it will grouping with other results, so we will know, time period for 0 output.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是一个缺口和孤岛问题。一种方法使用行数差异法:
This is a gaps and islands problem. One approach uses the difference in row numbers method: