方法)万能的窗口函数!
- 先按照日期升序排序,再按照姓名升序排序
- 有登录却没有刷题的哪一天的数据不需要输出
SELECT u.name, p.date, SUM(p.number)over(PARTITION BY u.id ORDER BY p.date) FROM passing_number AS p, user AS u WHERE p.user_id = u.id ORDER BY p.date, u.name;
方法)万能的窗口函数!
SELECT u.name, p.date, SUM(p.number)over(PARTITION BY u.id ORDER BY p.date) FROM passing_number AS p, user AS u WHERE p.user_id = u.id ORDER BY p.date, u.name;