today:
616
yesterday:
719
Total:
1,770,400

Technology

INNER JOIN & GROUP BY

admin 2020.10.16 21:17 Views : 178

 

Select TOTAL,DEDUCTION , d.DTYPE from (select SUM(AMOUNT) as "TOTAL",DEDUCTION from contribution c

WHERE TO_NUMBER(TO_CHAR(CONTRIBUTION_DATE, 'YYYY')) = 2020

-- AND UPPER(MISSIONARY_ID) = 'A02'

GROUP BY DEDUCTION ) 

INNER JOIN DEDUCTION_TYPE d

ON d.DTID = DEDUCTION

ORDER BY DEDUCTION

 

Select TOTAL,DEDUCTION , d.DTYPE, d.DTPERCENT from (select SUM(AMOUNT) as "TOTAL",DEDUCTION from contribution c

WHERE TO_NUMBER(TO_CHAR(CONTRIBUTION_DATE, 'YYYY')) = 2020

AND TO_NUMBER(TO_CHAR(CONTRIBUTION_DATE, 'MM')) = 2

-- AND UPPER(MISSIONARY_ID) = 'A02'

GROUP BY DEDUCTION ) 

INNER JOIN DEDUCTION_TYPE d

ON d.DTID = DEDUCTION

ORDER BY DEDUCTION