postgresql - get calculation value from previous row on postgresql
问题描述
| Date | Pending | Total
| 01-04-2021 | 5 | 4
| 01-03-2021 | 2 | 1
| 01-02-2021 | 1 | 1
| 01-01-2021 | 3 | 0
I want to update my table in PostgreSQL to have calculation from previous row which is previous day and get the value like the column above on Total
Total = Pending(today) - Total(day before)
解决方案
推荐阅读
- android - 在recyclerView中一屏显示多个项目
- reactjs - 当我在 getInitialProps 中调度时,下一个 js 应用程序不会将响应发送回浏览器
- python - 在 Python 中重新分配装饰器中的参数
- css - 如何用 css 创建一个“梨形”形状
- java - Apache MINA SFTP 符号链接示例
- mysql - 无法在 kubernetes 数据库中添加 .sql 文件
- python - 如何编写用于水平显示多个复选框的小部件?
- python - 使用产量进行文件处理?
- c# - 如何重置 RichTextBox 的 SelectedText 值(在 C# WinForms 应用程序中)?
- azure - 使用 Azure AD 凭据登录到 Azure VM