1

I am writing a bunch of queries to update All Subscribers list, and was surprised to see that when I put the condition xxx != yyy it only works if there are values in both columns. I was hoping that it would also return records if column xxx was empty. So now, I also included the following condition: OR xxx IS NULL. Is this the correct way to handle this?

SELECT ...
WHERE allsubs.Column1 != salesforcedata.Column1
OR allsubs.Column1 IS NULL
  • Just to confirm, you want to use salesforcedata.Column1 to be the source of the data when the allsubs.Column1 is either different from SF data or null, right? – Rafał Wolsztyniak May 21 at 8:27
  • Yes, that's right. – zuzannamj May 21 at 8:30
1

Yes, your code is correct. Quick tests would confirm that if you just made two data extensions with mock data.

Depending what you are trying to achieve you might to also consider a case when the salesforcedata.Column1 is null. For example when the customer wants to remove his address from your database (for GDPR compliance).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.