Search Postgresql Archives

Re: table returning function for each row in other resultset

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

 



On Wed, Feb 3, 2021 at 8:01 AM Niels Jespersen <NJN@xxxxxx> wrote:
Hello all

I have som data in a resultset. E.g:

id date_begin date_end      amount
1  2021-01-04 2021-02-06  100
2  2021-03-17 2021-05-11  234

I have a table returning function that can take one row and split it into constituent monthpieces and distribute amount proportionally.

select * from func(1, 2021-01-04, 2021-02-06, 100);
[...]
How can I accomplish this, please.

Lateral Join.

(not tested)
SELECT *
FROM resultset, func(id, date_begin, date_end, amount);

David J.


[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 Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux