sub select as a data column

Поиск
Список
Период
Сортировка
От Phong & Ronni Bounmixay
Тема sub select as a data column
Дата
Msg-id 7838141f0511281218v6bfab669rc87a96588f1d5713@mail.gmail.com
обсуждение исходный текст
Ответы Re: sub select as a data column
Re: sub select as a data column
Список 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 по дате отправления: