QuestionQ97

VerifiedData Design

A consultant needs to email subscribers who have placed a purchase. The send data is stored in two data extensions, Subscribers and Orders, and must include key information from both tables, such as:

  • CustomerID
  • FirstName
  • EmailAddress
  • OrderID
  • OrderDate
  • ShippedDate

Which SQL statement should the consultant use?

Explanation

An inner join on the two tables’ CustomerID fields returns only subscribers with matching order records. Qualifying every selected field with the appropriate table alias prevents ambiguity where both tables contain CustomerID; Salesforce SQL Query Activities support joins and require explicit column selection instead of SELECT * when using a join.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!