Re: Accumulated sums in SQL query

From: Christoph Haller <ch(at)rodos(dot)fzk(dot)de>
To: kabai(at)audiobox(dot)hu
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Accumulated sums in SQL query
Date: 2002-10-28 08:20:31
Message-ID: 3DBCF34F.9F6ACBA8@rodos.fzk.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

> Which is the simplest way to create an SQL query to get accumulated
sums of
> records like this (from the table containing the numbers):
>
> number sums
> ---------------
> 1 1
> 2 3
> 3 6
> 4 10
>
SELECT number, SUM(your_sum_column) FROM your_table
GROUP BY number ;

Regards, Christoph

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Kabai Jzsef 2002-10-28 09:07:18 Re: Accumulated sums in SQL query
Previous Message Kabai Jzsef 2002-10-28 08:13:56 Accumulated sums in SQL query