today:
462
yesterday:
719
Total:
1,770,246

Technology

JOIN

admin 2018.09.29 17:26 Views : 273

select MONTH,(NVL(e.REGIONAL_FUND,0)+NVL(e.PENSION,0)+NVL(e.MISSIONARY_KEEP,0)+NVL(e.PERSONAL,0)+NVL(e.PAYPAL,0)+NVL(e.WIRE_FEE,0)+NVL(e.OTHERS,0)) 

 as "EXPENSE TOTAL" from EXPENSES e

WHERE :P35_YEAR = e.YEAR AND UPPER(:P35_MISSIONARY_ID) = UPPER(e.MISSIONARY_ID)

 

select r.month,SUM(r.AMOUNT),SUM(r.AMOUNT*d.DTPERCENT/100) as "DEDUCTION AMOUNT",SUM((r.AMOUNT-r.AMOUNT*d.DTPERCENT/100)) as "TRANSFER AMOUNT"

from DEDUCTION_RESULT r, DEDUCTION_TYPE d

where NVL(r.DEDUCTION,0) = d.DTID

GROUP BY month

 

SELECT * 

FROM emp INNER JOIN dept

ON emp.deptno = dept.deptno

 

 

SELECT * 

FROM DEDUCTION_RESULT d LEFT JOIN EXPENSES e

ON d.MONTH = e.MONTH

 

SELECT * 

FROM emp INNER JOIN dept

ON emp.deptno = dept.deptno

 

select MONTH,(NVL(e.REGIONAL_FUND,0)+NVL(e.PENSION,0)+NVL(e.MISSIONARY_KEEP,0)+NVL(e.PERSONAL,0)+NVL(e.PAYPAL,0)+NVL(e.WIRE_FEE,0)+NVL(e.OTHERS,0)) 

 as "EXPENSE TOTAL" from EXPENSES e

WHERE :P35_YEAR = e.YEAR AND UPPER(:P35_MISSIONARY_ID) = UPPER(e.MISSIONARY_ID)

 

select r.month,SUM(r.AMOUNT),SUM(r.AMOUNT*d.DTPERCENT/100) as "DEDUCTION AMOUNT",SUM((r.AMOUNT-r.AMOUNT*d.DTPERCENT/100)) as "TRANSFER AMOUNT"

from DEDUCTION_RESULT r, DEDUCTION_TYPE d

where NVL(r.DEDUCTION,0) = d.DTID

GROUP BY month

 

SELECT * 

FROM emp INNER JOIN dept

ON emp.deptno = dept.deptno