Skip to content

Instantly share code, notes, and snippets.

View Jammink2's full-sized avatar

John Hammink Jammink2

View GitHub Profile
SELECT email FROM <tbl_name> GROUP BY email HAVING COUNT(1) > 1 -- to find duplicate emails
https://in.treasuredata.com/postback/v3/event/<Your_TD_Database>/<Your_TD_Table>?td_write_key=<your_TD_API_Write_key>
td connector:guess -o sfdc_contact_output.yml sfdc_contacts.yml && td connector:issue sfdc_contact_output.yml --database sfdc2 --table contact
## note: only an example! Please edit to conform to actual command line
td connector:create \
daily_sfdc_import \
"10 0 * * *" \
td_sample_db \
td_sample_table \
load.yml
in:
type: sfdc
username: "<my_username>"
password: "<my_password>"
client_id: "<my_client_id>" # your app's consumer key
client_secret: "<my_client_secret>" # your app's consumer secret
security_token: "<my_security token>" # your logged-in user's security token
login_url: https://cs27.salesforce.com/
incremental: false
target: Account
in:
type: sfdc
username: "<my_username>"
password: "<my_password>"
client_id: "<my_client_id>" # your app's consumer key
client_secret: "<my_client_secret>" # your app's consumer secret
security_token: "<my_security_token>" # your logged-in user's security token
login_url: https://cs27.salesforce.com/
incremental: false
target: Contact
td connector:guess -o sfdc_account_output.yml sfdc_accounts.yml && td connector:issue sfdc_account_output.yml --database sfdc --table account
td connector:guess -o sfdc_contact_output.yml sfdc_contacts.yml && td connector:issue sfdc_contact_output.yml --database sfdc --table contact
region coverage
Europe 0.5939597315
Asia / Pacific 0.776635514
South America 0.3666666667
Middle East / Africa 0.2740740741
WITH t1 AS(
SELECT
id AS account_id,
region__c AS region
FROM
account
WHERE
target_account__c = 1
),
t2 AS(