today:
1,696
yesterday:
2,350
Total:
1,306,109

10/24/2020

2020.10.24 21:01 Views : 112

DECLARE

 SSID2 NUMBER;

 SSID NUMBER;

 SID NUMBER; 

 SAMOUNT NUMBER;

 STARTDATE NUMBER;  

 

BEGIN

delete from MISSIONARY_SUB_2;

delete from MISSIONARY_SUB2_2;

delete from MISSIONARY_YEAR2;

 

/* Select Missionary */

insert into MISSIONARY_SUB_2

Select 

MISSIONARY_ID,SUPPORTER_ID,AMOUNT,CONTRIBUTION_DATE, to_number(to_char(CONTRIBUTION_DATE,'MM')), 

to_number(to_char(CONTRIBUTION_DATE,'YYYY')),

to_number(to_char(CONTRIBUTION_DATE,'MM'))+ to_number(to_char(CONTRIBUTION_DATE,'YYYY'))*100

from CONTRIBUTION 

where UPPER(:P112_MISSIONARY_ID) = MISSIONARY_ID 

and CONTRIBUTION_DATE BETWEEN :P112_FROM AND :P112_TO;

 

/* Sum Supporter's Contribution */

insert into MISSIONARY_SUB2_2

Select 

SSID,SUM(SAMOUNT),SYYYYMM

from MISSIONARY_SUB_2 

Group by SSID,SYYYYMM;

/*COMMIT;

END;

STARTDATE := (Select MIN(SDATE2) FROM MISSIONARY_SUB2_2);*/

 

INSERT INTO MISSIONARY_YEAR2 (SID)

SELECT DISTINCT SSID FROM MISSIONARY_SUB_2;

/* Loop */

     FOR x IN (Select * from MISSIONARY_YEAR2) LOOP

 

     UPDATE MISSIONARY_YEAR2

     SET MON1 = (SELECT SAMOUNT2 FROM MISSIONARY_SUB2_2 WHERE SSID2 = x.SID AND SDATE2 = (Select MIN(SDATE2) FROM MISSIONARY_SUB2_2))

     WHERE SID = x.SID;

 

     UPDATE MISSIONARY_YEAR2

     SET MON2 = (SELECT SAMOUNT2 FROM MISSIONARY_SUB2_2 WHERE SSID2 = x.SID AND SDATE2 = (Select MIN(SDATE2) FROM MISSIONARY_SUB2_2)+1)

     WHERE SID = x.SID;

     

     END LOOP;

 

COMMIT;

END;

 

select * from MISSIONARY_YEAR2

select * from MISSIONARY_SUB_2

select * from MISSIONARY_SUB2_2

select to_date('092015','mmyyyy') from dual

 

    dt

1   09/01/2015

No. Subject Date Views
Notice Jon Voight: Pray Donald Trump makes a ‘comeback stronger than ever’ 2022.08.12 1753
Notice America's Anthem 2020.12.27 1761
636 Billion corruption of the Biden family, soon to be judged 2020.10.29 167
635 Billion corruption of the Biden family, soon to be judged 2020.10.29 217
634 POLL 10/28/2020 file 2020.10.28 424
633 POLL 10/28/2020 file 2020.10.28 419
632 Philadelphia DA threatens Trump over president's call for poll watchers: 'I've got something for you' 2020.10.28 193
631 Philadelphia DA threatens Trump over president's call for poll watchers: 'I've got something for you' 2020.10.28 213
630 In California, Trump is starting to lead in approval ratings. 2020.10.26 230
629 In California, Trump is starting to lead in approval ratings. 2020.10.26 209
628 Silverado Canyon Fire Spreads to 7,200 Acres, Mandatory Evacuation in Irvine as Firefighters Battle High Winds 2020.10.26 202
627 Silverado Canyon Fire Spreads to 7,200 Acres, Mandatory Evacuation in Irvine as Firefighters Battle High Winds 2020.10.26 239
626 Amy Coney Barrett confirmed to Supreme Court in final Senate vote 2020.10.26 257
625 Amy Coney Barrett confirmed to Supreme Court in final Senate vote 2020.10.26 264
624 These 15 Black Celebrities Are Voting for Donald Trump in the 2020 US Election (Confession Included) 2020.10.26 212
623 These 15 Black Celebrities Are Voting for Donald Trump in the 2020 US Election (Confession Included) 2020.10.26 264
622 Biden schedules no Monday events, as Trump stumps in Pennsylvania during campaign's final week 2020.10.26 249
621 Biden schedules no Monday events, as Trump stumps in Pennsylvania during campaign's final week 2020.10.26 254
620 10/24/2020 2020.10.24 137
» 10/24/2020 2020.10.24 112
618 Biden Motorcade Vs Trump Motorcade 2020.10.24 204
617 Biden Motorcade Vs Trump Motorcade 2020.10.24 196
616 CROWD SIZE: Barack Obama And Joe Biden Supporters In Philadelphia 2020.10.24 299
615 CROWD SIZE: Barack Obama And Joe Biden Supporters In Philadelphia 2020.10.24 292
614 CBS News vs CNN 2020.10.24 294
613 CBS News vs CNN 2020.10.24 229
612 George Soros is the son of a bitch cattle, Russ. 2020.10.22 214
611 George Soros is the son of a bitch cattle, Russ. 2020.10.22 291
610 CNN'S FAKE NEWS file 2020.10.22 203
609 CNN'S FAKE NEWS file 2020.10.22 174
608 YOU ARE NOT AUTHORIZED TO VIEW THIS CONTENT 2020.10.21 248
607 YOU ARE NOT AUTHORIZED TO VIEW THIS CONTENT 2020.10.21 227