Skip to content

Instantly share code, notes, and snippets.

@dgershman
Created February 1, 2016 03:16
Show Gist options
  • Select an option

  • Save dgershman/335dcfe8c5fe62efeb7b to your computer and use it in GitHub Desktop.

Select an option

Save dgershman/335dcfe8c5fe62efeb7b to your computer and use it in GitHub Desktop.
INSERT INTO `na_comdef_meetings_main` (`id_bigint`,`worldid_mixed`, `shared_group_id_bigint`, `service_body_bigint`, `weekday_tinyint`, `start_time`, `duration_time`, `formats`, `lang_enum`, `longitude`, `latitude`, `published`, `email_contact`)
SELECT
Id As `id_bigint`,
NULL As `worldid_mixed`,
NULL As `shared_group_id_bigint`,
CASE `Area`
WHEN 'Down East' THEN 3 #Down East
WHEN 'Inner Coastal' THEN 4 #Inner Coastal
WHEN 'Southern Piedmont' THEN 5 #Southern Piedmont
WHEN 'Greensboro' THEN 6 #Greensboro
WHEN 'Tar-Roanoke' THEN 7 #Tar-Roanoke
WHEN 'Greater Sandhills' THEN 8 #Greater Sandhills
WHEN 'Our Primary Purpose' THEN 9 #Our Primary Purpose
WHEN 'Mountain' THEN 10 #NC Mountain
END As `service_body_bigint`,
CASE `Day`
WHEN 'Sunday' THEN 0
WHEN 'Monday' THEN 1
WHEN 'Tuesday' THEN 2
WHEN 'Wednesday' THEN 3
WHEN 'Thursday' THEN 4
WHEN 'Friday' THEN 5
WHEN 'Saturday' THEN 6
END As `weekday_tinyint`,
TIME(STR_TO_DATE(`Time`, '%h:%i %p')) As `start_time`,
'01:00' As `duration_time`,
NULL As `formats`,
'en' As `lang_enum`,
NULL as `longitude`,
NULL as `latitude`,
1 as `published`,
'' AS `email_contact`
FROM `imported`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment