Skip to content

Instantly share code, notes, and snippets.

@dominijk
Created July 16, 2017 18:54
Show Gist options
  • Save dominijk/82a5877e34da90b208a15da6f20d274c to your computer and use it in GitHub Desktop.
Save dominijk/82a5877e34da90b208a15da6f20d274c to your computer and use it in GitHub Desktop.
VOA Record 1 data
--for taking query views into main analysis table
update analysis_by_postcode_sector
set scat18_1sqm_sector = voarecord1_analysis_bysector_scat_18_all.voa_list_sector,
scat18_all_sum = voarecord1_analysis_bysector_scat_18_all.sum,
scat18_all_avg = voarecord1_analysis_bysector_scat_18_all.avg,
scat18_all_max = voarecord1_analysis_bysector_scat_18_all.max
from voarecord1_analysis_bysector_scat_18_all
where analysis_by_postcode_sector.voa_record1_sector_name_check::text = voarecord1_analysis_bysector_scat_18_all.voa_list_sector::text;
--cs18all
update analysis_by_postcode_sector
set pcode_cs51_all_sector = voarecord1_analysis_bysector_primarycode_cs_51sqm.voa_list_sector,
pcode_cs51_all_sum = voarecord1_analysis_bysector_primarycode_cs_51sqm.sum,
pcode_cs51_all_avg = voarecord1_analysis_bysector_primarycode_cs_51sqm.avg,
pcode_cs51_all_max = voarecord1_analysis_bysector_primarycode_cs_51sqm.max
from voarecord1_analysis_bysector_primarycode_cs_51sqm
where analysis_by_postcode_sector.voa_record1_sector_name_check::text = voarecord1_analysis_bysector_primarycode_cs_51sqm.voa_list_sector::text;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment