0

There are two separate DEs in Marketing Cloud - 'ts2__Placement__c_Salesforce' and 'Contact_Salesforce'. I have created a 3rd DE same using exactly same fields as in 'Contact_Salesforce' and added couple more fields ('Placement_Country__c' and 'candidate_ID__c') which are there in 'ts2__Placement__c_Salesforce'. This 3rd DE has 'Id' as primary key.

Now I am trying to join these two tables into the third one using the following query:

Select
c.Id, 
c.SS_Disciplines__c, 
c.MailingCountry,
p.Placement_Country__c, 
p.candidate_ID__c

From ts2__Placement__c_Salesforce p

JOIN Contact_Salesforce c 
ON c.Id = p.candidate_ID__c

(Id is the primary key in 'Contact_Salesforce' but 'candidate_ID__c' is not primary key in 'ts2__Placement__c_Salesforce')

This query is not showing any error but also not fetching any records. Problem is somewhere with the 'join' only as if I run the query on any one of the DE without using 'join', it works.

5
  • Hi, what is the insertion mode? "Overwrite"? What is the expected result if an Id is found in "ts2__Placement__c_Salesforce" multiple times? With "Id" as primary key in the target DE, you will only be able to store one record per Id there. Isolate: What happens if you overwrite into a target DE without Primary Key? Commented Aug 17, 2020 at 9:46
  • Hi Jonas, 'Id' in 'Contact_Salesforce' is primary and unique. There is an 'Id' (Primary) field in 'ts2__Placement__c_Salesforce' but that's different, however in this table 'candidate_ID__c' field is same as 'Id' in 'Contact_Salesforce'.
    – Ajay
    Commented Aug 17, 2020 at 10:57
  • Can you try a RIGHT JOIN instead of just JOIN? Also, is there more than one record for the same candidate_ID__c? If yes, then make sure you’re not using a Primary Key in your target DE
    – zuzannamj
    Commented Aug 17, 2020 at 11:13
  • Are both c.Id && p.candidate_ID__c using the 18 Digit ID? or is p.candidate_ID__c a 15 digit ContactID?
    – EazyE
    Commented Aug 17, 2020 at 12:33
  • Thank you everyone for your help. Finally I realized that subscription relationship in one of the DE was wrong. Also, 'Right Join' was trying to put empty data into a primary key field. All well now. Thanks again.
    – Ajay
    Commented Aug 17, 2020 at 15:37

0

You must log in to answer this question.

Browse other questions tagged .