today:
154
yesterday:
242
Total:
1,004,312

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 540
Notice America's Anthem 2020.12.27 638
1176 House Legislation to Prevent ‘China’s Abuses’ of US Visa Programs: Rep. Banks file 2022.05.13 289
1175 Tustin Legacy park is on its way file 2018.12.02 287
1174 Trump Says Supreme Court ‘Incompetent and Weak’ Over Election Fraud 2020.12.26 285
1173 Trump's landslide victory to be confirmed file 2020.11.21 285
1172 Counties With Highest Vaccination Rates See More COVID-19 Cases Than Least Vaccinated 2022.04.04 282
1171 Who is this attending the inauguration at the Corporation of the United States of No States? file 2021.01.21 280
1170 Zuckerberg-Funded Group Comes Into Spotlight in Election-Related Court Cases 2020.11.28 280
1169 Zuckerberg-Funded Group Comes Into Spotlight in Election-Related Court Cases 2020.11.28 276
1168 Georgia Data Shows 17,650 of Trump’s Votes Removed, Another 12,173 Switched to Biden: Data Scientists 2021.01.02 275
1167 Man found fatally shot near car abandoned off 5 Freeway in Irvine 2020.06.09 274
1166 About 73% Biden Vote Margin Gain in PA from Areas Given $18 Million by Zuckerberg-Funded ‘Safe Elections’ Project 2020.11.19 272
1165 Biden debate mistake 'could cost him the election' 2020.10.12 270
1164 Man found fatally shot near car abandoned off 5 Freeway in Irvine 2020.06.09 267
1163 Trump Suggests He’ll Appoint ‘Special Prosecutor’ file 2020.11.29 265
1162 About 73% Biden Vote Margin Gain in PA from Areas Given $18 Million by Zuckerberg-Funded ‘Safe Elections’ Project 2020.11.19 264
1161 Map shows coronavirus cases in Orange County cities 2020.03.28 262
1160 Forced repatriation of North Korean defectors in 2019 file 2022.04.02 261
1159 GSA Head Emily Murphy Receives Threats for Not Acknowledging Biden as Winner 2020.11.24 259
1158 [ Biden Spike ] Crowd Gasps After Giuliani Reveals A "Spike" Of 570,000 Votes For Biden And 3,200 For Trump file 2020.11.25 258
1157 GSA Head Emily Murphy Receives Threats for Not Acknowledging Biden as Winner 2020.11.24 257
1156 Map shows coronavirus cases in Orange County cities 2020.03.28 256
1155 HONG KONG IS HONG KONG NOT CHINA file 2019.08.17 256
1154 Orange County Fire Authority offers $50 million proposal to keep Irvine from leaving file 2019.03.26 255
1153 Digital Forensic Analysis Shows Dominion’s Server Connected to Iran and China: Affidavit 2020.11.27 253
1152 Georgia Officials Investigating After Old Voting Machines Found Dumped Near Savannah 2020.11.20 252
1151 노후한 서울 하수도 71%인데… 市, 평양 상하수도 공사에 10억 배정 file 2019.04.10 252
1150 HONG KONG IS HONG KONG NOT CHINA file 2019.08.17 251
1149 노후한 서울 하수도 71%인데… 市, 평양 상하수도 공사에 10억 배정 file 2019.04.10 250
1148 China Insider: Powell: Planeload of Fake Chinese-Made Ballots Arrive from Mexico 2020.12.09 249
1147 UC Irvine student is still missing, family says file 2018.12.07 249