我有查询,我在哪里调用函数StoreFlowsByDates
select
sum(a.beglocalamount+a.localamount)
from
StoreFlowsByDates(ib_encodedate(EXTRACT(YEAR FROM CURRENT_DATE),1 ,1), ib_encodedate(EXTRACT(YEAR FROM CURRENT_DATE), 12 ,31), '', '', '', '', '', '', '', 'N', 'N', 'N', 'N', '1000000101', '') a
此函数返回选定期间的值。我需要编辑此查询以返回一年中每个月的值。就像是:
select
sum(a.beglocalamount+a.localamount),
[SELECTED_MONTH]
from
StoreFlowsByDates(ib_encodedate(EXTRACT(YEAR FROM CURRENT_DATE),[SELECTED_MONTH] ,1), ib_encodedate(EXTRACT(YEAR FROM CURRENT_DATE), [SELECTED_MONTH] ,31), '', '', '', '', '', '', '', 'N', 'N', 'N', 'N', '1000000101', '') a
group by
[SELECTED_MONTH]
但在从 1 到 12 的循环中。这样的事情甚至可能吗?