today:
55
yesterday:
158
Total:
1,001,309

10/24/2020

2020.10.24 21:01 Views : 47

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 530
Notice America's Anthem 2020.12.27 637
1176 New Trump Petition Asks Supreme Court to Overturn Pennsylvania Election Results file 2020.12.20 45
1175 White House, Hillary Clinton Decline to Comment on Durham Allegations file 2022.02.18 45
1174 Ukrainian President Suggests Developing Sanction Package to Deter Russian Aggression file 2022.02.20 45
1173 China is responsible for this coronavirus ( COVID-19 ) 2020.03.31 46
1172 Macron questions China's handling of outbreak 2020.04.21 46
1171 Portland assault video says it was a ‘random’ attack 2020.08.18 46
1170 SoCal church sues over Gov. Newsom's singing ban 2020.08.30 46
1169 TRUMP WON file 2020.11.03 46
1168 Facebook and Twitter Suck 2020.11.11 46
1167 Congress has right to reject Electoral College votes 2020.11.21 46
1166 Sidney Powell: It will be BIBLICAL 2020.11.23 46
1165 SOUTHERN CALIFORNIA CORONAVIRUS CASES - 03/30/2020 file 2020.03.30 46
1164 BREAKING: Georgia Elections Says: "WE ARE GOING TO FIND ILLEGAL VOTES ON ELECTION DAY" 2020.11.09 46
1163 Lawsuits and Recounts - Michigan 2020.11.21 46
1162 Congress has right to reject Electoral College votes 2020.11.21 46
1161 Learning Chinese 2022.02.04 46
1160 Washington state ; 7th coronavirus death 2020.03.03 47
1159 Orange County coronavirus cases 2020.03.31 47
1158 China stifles coronavirus research in apparent bid to control narrative 2020.04.12 47
1157 NYPD Officer Allegedly Acted as Agent for Chinese Government, Complaint Says 2020.09.21 47
1156 Joe Biden: China's Puppet 2020.09.22 47
» 10/24/2020 2020.10.24 47
1154 Comedians Warn of Biden's Stupidity - You be the Judge 2020.11.01 47
1153 The election integrity group True the Vote is suing Pennsylvania Gov 2020.11.11 47
1152 Voting System Examination Dominion Voting Systems Democracy Suite 5.5-A file 2020.11.17 47
1151 Director of National Intelligence: Election ‘Issues’ Need to Be Resolved Before Winner Declared 2020.12.07 47
1150 New Trump Petition Asks Supreme Court to Overturn Pennsylvania Election Results file 2020.12.20 47
1149 Foods Exported From China You Should Never Eat - Tea 2020.05.18 47
1148 EXCLUSIVE: Swalwell DEFENDED CHINA Over Criticism | Rep. Kevin McCarthy | Huckabee 2020.12.13 47
1147 Live: Trump holds rally in Georgia ahead of Senate runoff 2021.01.04 47