Skip to content

Instantly share code, notes, and snippets.

@mbraga-sfdc
Last active December 14, 2020 17:36
Show Gist options
  • Save mbraga-sfdc/b3efb9c4ae153113fb0f60c8b0ff82f3 to your computer and use it in GitHub Desktop.
Save mbraga-sfdc/b3efb9c4ae153113fb0f60c8b0ff82f3 to your computer and use it in GitHub Desktop.
data view for multi-org visibility for work.com blog post #3
CREATE OR REPLACE VIEW global_assessment as
SELECT contact.sfid as id, industry, account.name, phone, fax,
lastname, firstname, email, mobilephone,
'AMER' AS geo
FROM amer.account, amer.contact
WHERE amer.account.sfid = amer.contact.accountid
UNION
SELECT contact.sfid as id, industry, account.name, phone, fax,
lastname, firstname, email, mobilephone,
'EMEA' AS geo
FROM emea.account, emea.contact
WHERE emea.account.sfid = emea.contact.accountid;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment