举例说明:
员工每个月都会有薪水,需要查出每个月的薪水以及累计薪水,可以用下面SQL语句查询:
SELECT MONTH, SALARY, SUM(SALARY) OVER(ORDER BY MONTH ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) SUM_SALARY FROM USER_SALARY
举例说明:
员工每个月都会有薪水,需要查出每个月的薪水以及累计薪水,可以用下面SQL语句查询:
SELECT MONTH, SALARY, SUM(SALARY) OVER(ORDER BY MONTH ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) SUM_SALARY FROM USER_SALARY