sql - 如何使用周数和年份查找上一行
问题描述
解决方案
ORDER
and filter by the WEEKNUM + (YEARNUM * 52)
as a single derived column instead of trying to apply some kind of AND/OR
logic.
You might also use ROW_NUMBER()
to create a cardinal column so you can easily get the previous row. Or you might look into using the LAG()
function.
推荐阅读
- elixir - 获取要在 where 子句中使用的连接值模式
- android - 在 android-studio 中设置 imageview
- python - 如何在 Python 中为顺序数据编码虚拟变量,以便始终保持相同的顺序?
- mysql - 使用“AS SELECT”时如何设置 AUTO_INCREMENT PRIMARY KEY
- racket - 如何从 Racket 的矩阵中逐行获取元素?
- javascript - TypeError:无法读取未定义的属性“字符”
- css - 在一个元素上反应原生动画多个动画
- android - gradle withJavadocJar() 和 withSourcesJar() 用于 android 库
- c# - 通过优先合并其他三个来创建对象(C# .NET 3.5)
- java - 将代码从php转换为java。我转换了大部分代码,但我仍然遇到一些错误