题目链接:点击打开链接
题目大意:略。
解题思路:略。
AC 代码
SELECT account_id, day, SUM(IF(type = 'Withdraw', -amount, amount)) OVER(PARTITION BY account_id ORDER BY account_id, day) balance FROM Transactions
题目链接:点击打开链接
题目大意:略。
解题思路:略。
AC 代码
SELECT account_id, day, SUM(IF(type = 'Withdraw', -amount, amount)) OVER(PARTITION BY account_id ORDER BY account_id, day) balance FROM Transactions