sql >> Database teknologi >  >> RDS >> Oracle

Forespørgsel om at beregne både kumulativ og samlet SUM over løn

SELECT name,
location,
salary,
SUM(salary) OVER ( ORDER BY name) AS running_Salary,
/* order by name can replaced with rownum or rowid , but has to be some
column for perfect ordering as internal order is not judgeable */
SUM(salary) OVER () AS total_salary
FROM yourtable

SQL Fiddle



  1. Installation af Oracle 9i Developer Suite 2.0 på Windows

  2. Kan jeg bruge ADFS 2.0 til at godkende visse brugere mod SQL Server?

  3. Hvordan får man aktuel dato i PL/SQL?

  4. ClassNotFoundException med PostgreSQL og JDBC