Search Postgresql Archives

sub select as a data column

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux