-- $RCSfile: calc-stats.sql   $
-- $Author: tgeorgeokstate    $
-- $Revision: 1.0             $
-- $Date: 2003/09/25 19:22:56 $
-- $Comment: Use this to calculate weekly stats from cumulative files
-- $ make sure that you change the fflweek# and si_week# numbers each time

drop table if exists ffl_week4;
CREATE TABLE ffl_week4 (stat_id int not null auto_increment, primary key (stat_id)) SELECT si_week4.PlayerName, 
si_week4.TeamAbbName, 
si_week4.GP-si_week3.GP AS GP, 
si_week4.PAtt-si_week3.PAtt AS PAtt, 
si_week4.PComp-si_week3.PComp AS PComp, 
si_week4.PYds-si_week3.PYds AS PYds, 
si_week4.PTD-si_week3.PTD AS PTD, 
si_week4.PInt-si_week3.PInt AS PInt, 
si_week4.PLong-si_week3.PLong AS PLong, 
si_week4.PSack-si_week3.PSack AS PSack, 
si_week4.PYdsL-si_week3.PYdsL AS PYdsL, 
si_week4.SRush-si_week3.SRush AS SRush, 
si_week4.SYds-si_week3.SYds AS SYds, 
si_week4.SLng-si_week3.SLng AS SLng, 
si_week4.STD-si_week3.STD AS STD, 
si_week4.CRec-si_week3.CRec AS CRec, 
si_week4.CYds-si_week3.CYds AS CYds, 
si_week4.CLng-si_week3.CLng AS CLng, 
si_week4.CYAC-si_week3.CYAC AS CYAC, 
si_week4.C1stD-si_week3.C1stD AS C1stD, 
si_week4.CTD-si_week3.CTD AS CTD, 
si_week4.Fum-si_week3.Fum AS Fum, 
si_week4.FumL-si_week3.FumL AS FumL, 
si_week4.K00-si_week3.K00 AS K00, 
si_week4.K20-si_week3.K20 AS K20, 
si_week4.K30-si_week3.K30 AS K30, 
si_week4.K40-si_week3.K40 AS K40, 
si_week4.K50-si_week3.K50 AS K50, 
si_week4.KFGA-si_week3.KFGA AS KFGA, 
si_week4.KFGM-si_week3.KFGM AS KFGM, 
si_week4.KLng-si_week3.KLng AS KLng, 
si_week4.XPM-si_week3.XPM AS XPM, 
si_week4.XPA-si_week3.XPA AS XPA, 
si_week4.KR-si_week3.KR AS KR, 
si_week4.KRYds-si_week3.KRYds AS KRYds, 
si_week4.KRFC-si_week3.KRFC AS KRFC, 
si_week4.KRLong-si_week3.KRLong AS KRLong, 
si_week4.KRTD-si_week3.KRTD AS KRTD, 
si_week4.PR-si_week3.PR AS PR, 
si_week4.PRYds-si_week3.PRYds AS PRYds, 
si_week4.PRFC-si_week3.PRFC AS PRFC, 
si_week4.PRLong-si_week3.PRLong AS PRLong, 
si_week4.PRTD-si_week3.PRTD AS PRTD, 
si_week4.Punt-si_week3.Punt AS Punt, 
si_week4.TYds-si_week3.TYds AS TYds, 
si_week4.TIn20-si_week3.TIn20 AS TIn20, 
si_week4.TIn10-si_week3.TIn10 AS TIn10, 
si_week4.TTB-si_week3.TTB AS TTB, 
si_week4.TLong-si_week3.TLong AS TLong, 
si_week4.TkSolo-si_week3.TkSolo AS TkSolo, 
si_week4.TkAst-si_week3.TkAst AS TkAst, 
si_week4.TkTotal-si_week3.TkTotal AS TkTotal, 
si_week4.TkSack-si_week3.TkSack AS TkSack, 
si_week4.TkYdsL-si_week3.TkYdsL AS TkYdsL, 
si_week4.IntD-si_week3.IntD AS IntD, 
si_week4.IntYds-si_week3.IntYds AS IntYds, 
si_week4.IntTD-si_week3.IntTD AS IntTD, 
si_week4.PD-si_week3.PD AS PD, 
si_week4.Sfty-si_week3.Sfty AS Sfty, 
2003 AS NFLYear, 3 AS NFLWeek
FROM si_week3 RIGHT JOIN si_week4 ON 
(si_week3.TeamAbbName = si_week4.TeamAbbName) 
AND (si_week3.PlayerName = si_week4.PlayerName);
