sub select as a data column - Mailing list pgsql-general

From Phong & Ronni Bounmixay
Subject sub select as a data column
Date
Msg-id 7838141f0511281218v6bfab669rc87a96588f1d5713@mail.gmail.com
Whole thread Raw
Responses Re: sub select as a data column  ("Jim Buttafuoco" <jim@contactbda.com>)
Re: sub select as a data column  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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

pgsql-general by date:

Previous
From: Marek Lewczuk
Date:
Subject: intarray index
Next
From: Timothy Perrigo
Date:
Subject: problem with psql?