Issue: Using the documentation linked below, I tried inner joining two SOQL tables together without success. Can anyone help me figure out what's wrong? Assuming it has to do with the syntax (i.e. parenthesis). Thanks in advance!
Documentation for Joins:
Python SOQL Code:
records = sf.query_all('SELECT Event__c.Id, Event__c.Supplier__c,' +
' Event__c.Promo_Models__c, Event__c.Lead_Promo_Model_Name__c,' +
' Event__c.Event_Date__c, Consumer_Feedback__c,' +
' (SELECT Contact.Gender__c, Contact.Ethnicity__c, Contact.CreatedDate FROM Contact)' +
' FROM Event__c' +
' WHERE Event__c.Lead_Promo_Model__c IN (SELECT Contact.Id FROM Contact)' +
' AND Supplier__c LIKE \'ABCCompany%\'' +
' AND Event_Date__c > 2019-06-30' +
' AND Event_Date__c < 2020-07-01', include_deleted=False)
df_sf = pd.DataFrame(records['records'])
Error:
File "", line 10 ' WHERE Event__c.Lead_Promo_Model__c IN ('SELECT Contact.Id FROM Contact')' + ^ SyntaxError: invalid syntax
IN (SELECT Id FROM Contact), no? I can't promise that's your only issue though. - Abraham Labkovsky'...' + '...\'a\'...'by one"""SELECT multi-line... 'a' ..."""without backslashes and then it could be answered also by people that don't use Python. - hynekcer