Topic: Monthly average residuals under the balance account of Oracle
All kind time of days. Faced here such task:
Monthly average residuals under the balance account.
Input data: an account mask, date with, date on.
Output data: an account number, the currency code, monthly average residual.
Sorting: monthly average residual on decrease.
The remark: at first obtaining of residuals to personal accounts for each calendar day of the period (13 digits), then mean value obtaining.
With subqueries meanwhile , I ask the help. At least on an example to look as should look .
Here that made that, but it in a root not how it is necessary in a condition.
ACC.CODE "Account number", P_DIMENSION.GETDIMCODE (CURRENCY_ID) "Currency"
(SELECT-SUM (DEBET) AS DEBET
ACC.DATE_TURN BETWEEN ' 01/12/2009 ' AND ' 01/01/2010'
SELECT SUM (KREDIT) AS KREDIT
ACC.DATE_TURN BETWEEN ' 01/12/2009 ' AND ' 01/01/2010 ')
ACC.CODE LIKE ' 3012200599 %'