today:
184
yesterday:
297
Total:
1,112,415

10/24/2020

2020.10.24 22:01 Views : 76

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 1174
Notice America's Anthem 2020.12.27 1191
636 Billion corruption of the Biden family, soon to be judged 2020.10.29 107
635 Billion corruption of the Biden family, soon to be judged 2020.10.29 119
634 POLL 10/28/2020 file 2020.10.28 395
633 POLL 10/28/2020 file 2020.10.28 386
632 Philadelphia DA threatens Trump over president's call for poll watchers: 'I've got something for you' 2020.10.28 117
631 Philadelphia DA threatens Trump over president's call for poll watchers: 'I've got something for you' 2020.10.28 119
630 In California, Trump is starting to lead in approval ratings. 2020.10.26 128
629 In California, Trump is starting to lead in approval ratings. 2020.10.26 120
628 Silverado Canyon Fire Spreads to 7,200 Acres, Mandatory Evacuation in Irvine as Firefighters Battle High Winds 2020.10.26 119
627 Silverado Canyon Fire Spreads to 7,200 Acres, Mandatory Evacuation in Irvine as Firefighters Battle High Winds 2020.10.26 125
626 Amy Coney Barrett confirmed to Supreme Court in final Senate vote 2020.10.26 205
625 Amy Coney Barrett confirmed to Supreme Court in final Senate vote 2020.10.26 203
624 These 15 Black Celebrities Are Voting for Donald Trump in the 2020 US Election (Confession Included) 2020.10.26 124
623 These 15 Black Celebrities Are Voting for Donald Trump in the 2020 US Election (Confession Included) 2020.10.26 116
622 Biden schedules no Monday events, as Trump stumps in Pennsylvania during campaign's final week 2020.10.26 172
621 Biden schedules no Monday events, as Trump stumps in Pennsylvania during campaign's final week 2020.10.26 174
620 10/24/2020 2020.10.24 76
» 10/24/2020 2020.10.24 76
618 Biden Motorcade Vs Trump Motorcade 2020.10.24 119
617 Biden Motorcade Vs Trump Motorcade 2020.10.24 119
616 CROWD SIZE: Barack Obama And Joe Biden Supporters In Philadelphia 2020.10.24 266
615 CROWD SIZE: Barack Obama And Joe Biden Supporters In Philadelphia 2020.10.24 263
614 CBS News vs CNN 2020.10.24 121
613 CBS News vs CNN 2020.10.24 137
612 George Soros is the son of a bitch cattle, Russ. 2020.10.22 124
611 George Soros is the son of a bitch cattle, Russ. 2020.10.22 115
610 CNN'S FAKE NEWS file 2020.10.22 113
609 CNN'S FAKE NEWS file 2020.10.22 111
608 YOU ARE NOT AUTHORIZED TO VIEW THIS CONTENT 2020.10.21 128
607 YOU ARE NOT AUTHORIZED TO VIEW THIS CONTENT 2020.10.21 144