行号/排名“特定分区”
这是错误的row_number,我想计算它以便按真实分组日期几周(从星期一到周日),即 1对于前4行,2行从5到8,为9到13的行,等等。也许这可以通过等级解决,但是请注意,所需的列并不总是取决于Year_week的更改。结果表将是:
The row_number in this is wrong, I want to to compute it in order to group the dates by real weeks (from monday to sunday), i.e.
1 for the first 4 rows, 2 for rows from 5 to 8, 3 for rows from 9 to 13 and so on. Maybe this can be solve with rank, but notice the desired column not always is determined by the change in year_week. The resulting table would be:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只是为了结束答案...
搜索后,我发现此问题可以通过函数conditdital_change_event()解决,这并非在所有SQL lenguages中实现,而是可以被解释的。检查 ?有关更多信息。
Just for close the answer...
After some searching I found this problem can ve solve with the function CONDITIONAL_CHANGE_EVENT(), this is not implemented in all SQL lenguages, but can be explicited. Check Is there any alternative to Vertica's conditional_true_event in RedShift? for more information.