Skip to content

Instantly share code, notes, and snippets.

@krummja
Created April 15, 2022 20:13
Show Gist options
  • Save krummja/4cfe578816371ff105356b7d05576785 to your computer and use it in GitHub Desktop.
Save krummja/4cfe578816371ff105356b7d05576785 to your computer and use it in GitHub Desktop.
-- Export Companies from Hubspot
-- Create a new table and import the CSV data
-- Create a new table with all Contact info, where we'll add the Company Hubspot ID as "Company HID"
-- Select all from existing contacts table
-- Left Join the table created from the exported CSV where contact company_id = exported Company EID
create table contacts_add_company_hid
as
select *
from defaultdb_public_contacts
left join hubspot_companies_export
on defaultdb_public_contacts.company_id = cast(hubspot_companies_export."Company EID" as integer);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment