sub select as a data column

From: Phong & Ronni Bounmixay <bounmixay(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: sub select as a data column
Date: 2005-11-28 20:18:41
Message-ID: 7838141f0511281218v6bfab669rc87a96588f1d5713@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I am having trouble coming up with words to describe exactly what I need so
searching for a solution is getting frustrating! If this has been answered
twelve hundred times - please forgive me!

I want to do in postgresql what I do in oracle:

select year report_year,
sum(amount),
sum(select amount from my_table where year <= report_year)
from my_table
group by report_year;

I see lots of stuff on subselect in the from clause - but how do you
subselect as a data column?

Thanks for the help - it is SEVERLY appreciated!
Ronni

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jim C. Nasby 2005-11-28 20:59:50 Re: Why pgAdmin III guru suggests VACUUM in 8.1
Previous Message Timothy Perrigo 2005-11-28 19:24:37 problem with psql?