--Show all tables that contain relevant archive_day values
SELECT name FROM sqlite_master 
WHERE type IN ('table','view') 
AND name NOT LIKE 'sqlite_%'
AND name NOT LIKE 'archive'
AND name NOT LIKE 'archive_day__metadata'
ORDER BY 1;
--may vary
update archive_day_ET set wsum=sum, sumtime=count;
update archive_day_UV set wsum=sum, sumtime=count;
update archive_day_altimeter set wsum=sum, sumtime=count;
update archive_day_appTemp set wsum=sum, sumtime=count;
update archive_day_appTemp1 set wsum=sum, sumtime=count;
update archive_day_barometer set wsum=sum, sumtime=count;
update archive_day_batteryStatus1 set wsum=sum, sumtime=count;
update archive_day_batteryStatus2 set wsum=sum, sumtime=count;
update archive_day_batteryStatus3 set wsum=sum, sumtime=count;
update archive_day_batteryStatus4 set wsum=sum, sumtime=count;
update archive_day_batteryStatus5 set wsum=sum, sumtime=count;
update archive_day_batteryStatus6 set wsum=sum, sumtime=count;
update archive_day_batteryStatus7 set wsum=sum, sumtime=count;
update archive_day_batteryStatus8 set wsum=sum, sumtime=count;
update archive_day_cloudbase set wsum=sum, sumtime=count;
update archive_day_co set wsum=sum, sumtime=count;
update archive_day_co2 set wsum=sum, sumtime=count;
update archive_day_consBatteryVoltage set wsum=sum, sumtime=count;
update archive_day_dewpoint set wsum=sum, sumtime=count;
update archive_day_dewpoint1 set wsum=sum, sumtime=count;
update archive_day_extraHumid1 set wsum=sum, sumtime=count;
update archive_day_extraHumid2 set wsum=sum, sumtime=count;
update archive_day_extraHumid3 set wsum=sum, sumtime=count;
update archive_day_extraHumid4 set wsum=sum, sumtime=count;
update archive_day_extraHumid5 set wsum=sum, sumtime=count;
update archive_day_extraHumid6 set wsum=sum, sumtime=count;
update archive_day_extraHumid7 set wsum=sum, sumtime=count;
update archive_day_extraHumid8 set wsum=sum, sumtime=count;
update archive_day_extraTemp1 set wsum=sum, sumtime=count;
update archive_day_extraTemp2 set wsum=sum, sumtime=count;
update archive_day_extraTemp3 set wsum=sum, sumtime=count;
update archive_day_extraTemp4 set wsum=sum, sumtime=count;
update archive_day_extraTemp5 set wsum=sum, sumtime=count;
update archive_day_extraTemp6 set wsum=sum, sumtime=count;
update archive_day_extraTemp7 set wsum=sum, sumtime=count;
update archive_day_extraTemp8 set wsum=sum, sumtime=count;
update archive_day_forecast set wsum=sum, sumtime=count;
update archive_day_hail set wsum=sum, sumtime=count;
update archive_day_hailBatteryStatus set wsum=sum, sumtime=count;
update archive_day_hailRate set wsum=sum, sumtime=count;
update archive_day_heatindex set wsum=sum, sumtime=count;
update archive_day_heatindex1 set wsum=sum, sumtime=count;
update archive_day_heatingTemp set wsum=sum, sumtime=count;
update archive_day_heatingVoltage set wsum=sum, sumtime=count;
update archive_day_humidex set wsum=sum, sumtime=count;
update archive_day_humidex1 set wsum=sum, sumtime=count;
update archive_day_inDewpoint set wsum=sum, sumtime=count;
update archive_day_inHumidity set wsum=sum, sumtime=count;
update archive_day_inTemp set wsum=sum, sumtime=count;
update archive_day_inTempBatteryStatus set wsum=sum, sumtime=count;
update archive_day_leafTemp1 set wsum=sum, sumtime=count;
update archive_day_leafTemp2 set wsum=sum, sumtime=count;
update archive_day_leafWet1 set wsum=sum, sumtime=count;
update archive_day_leafWet2 set wsum=sum, sumtime=count;
update archive_day_lightning_distance set wsum=sum, sumtime=count;
update archive_day_lightning_disturber_count set wsum=sum, sumtime=count;
update archive_day_lightning_energy set wsum=sum, sumtime=count;
update archive_day_lightning_noise_count set wsum=sum, sumtime=count;
update archive_day_lightning_strike_count set wsum=sum, sumtime=count;
update archive_day_luminosity set wsum=sum, sumtime=count;
update archive_day_maxSolarRad set wsum=sum, sumtime=count;
update archive_day_nh3 set wsum=sum, sumtime=count;
update archive_day_no2 set wsum=sum, sumtime=count;
update archive_day_noise set wsum=sum, sumtime=count;
update archive_day_o3 set wsum=sum, sumtime=count;
update archive_day_outHumidity set wsum=sum, sumtime=count;
update archive_day_outTemp set wsum=sum, sumtime=count;
update archive_day_outTempBatteryStatus set wsum=sum, sumtime=count;
update archive_day_pb set wsum=sum, sumtime=count;
update archive_day_pm10_0 set wsum=sum, sumtime=count;
update archive_day_pm1_0 set wsum=sum, sumtime=count;
update archive_day_pm2_5 set wsum=sum, sumtime=count;
update archive_day_pressure set wsum=sum, sumtime=count;
update archive_day_radiation set wsum=sum, sumtime=count;
update archive_day_rain set wsum=sum, sumtime=count;
update archive_day_rainBatteryStatus set wsum=sum, sumtime=count;
update archive_day_rainRate set wsum=sum, sumtime=count;
update archive_day_referenceVoltage set wsum=sum, sumtime=count;
update archive_day_rxCheckPercent set wsum=sum, sumtime=count;
update archive_day_signal1 set wsum=sum, sumtime=count;
update archive_day_signal2 set wsum=sum, sumtime=count;
update archive_day_signal3 set wsum=sum, sumtime=count;
update archive_day_signal4 set wsum=sum, sumtime=count;
update archive_day_signal5 set wsum=sum, sumtime=count;
update archive_day_signal6 set wsum=sum, sumtime=count;
update archive_day_signal7 set wsum=sum, sumtime=count;
update archive_day_signal8 set wsum=sum, sumtime=count;
update archive_day_snow set wsum=sum, sumtime=count;
update archive_day_snowBatteryStatus set wsum=sum, sumtime=count;
update archive_day_snowDepth set wsum=sum, sumtime=count;
update archive_day_snowMoisture set wsum=sum, sumtime=count;
update archive_day_snowRate set wsum=sum, sumtime=count;
update archive_day_so2 set wsum=sum, sumtime=count;
update archive_day_soilMoist1 set wsum=sum, sumtime=count;
update archive_day_soilMoist2 set wsum=sum, sumtime=count;
update archive_day_soilMoist3 set wsum=sum, sumtime=count;
update archive_day_soilMoist4 set wsum=sum, sumtime=count;
update archive_day_soilTemp1 set wsum=sum, sumtime=count;
update archive_day_soilTemp2 set wsum=sum, sumtime=count;
update archive_day_soilTemp3 set wsum=sum, sumtime=count;
update archive_day_soilTemp4 set wsum=sum, sumtime=count;
update archive_day_supplyVoltage set wsum=sum, sumtime=count;
update archive_day_txBatteryStatus set wsum=sum, sumtime=count;
update archive_day_uvBatteryStatus set wsum=sum, sumtime=count;
update archive_day_wind set wsum=sum, sumtime=count;
update archive_day_windBatteryStatus set wsum=sum, sumtime=count;
update archive_day_windDir set wsum=sum, sumtime=count;
update archive_day_windGust set wsum=sum, sumtime=count;
update archive_day_windGustDir set wsum=sum, sumtime=count;
update archive_day_windSpeed set wsum=sum, sumtime=count;
update archive_day_windchill set wsum=sum, sumtime=count;
update archive_day_windrun set wsum=sum, sumtime=count;