0

Would anyone be able to help me write a query activity in Marketing Cloud? I’m getting “multi-part identifier” errors and, when I try to put two tables in the FROM, I’m getting the error “Old style (ANSI JOINs) syntax not allowed.

What I’m trying to write for the query is: If settings.Number equals history.Number AND settings.ID is 1, then select all fields in the DE.

I thought I could do the below, but I was wrong.

SELECT * 
FROM settings, history
WHERE setting.Number = history.Number AND settings.ID = 1
4
  • Do they contain the same fields? Commented Oct 12, 2017 at 17:09
  • No. And the only matching field would be .*Number
    – Harley
    Commented Oct 12, 2017 at 17:11
  • and you want all the fields for both DEs? or just one? Commented Oct 12, 2017 at 17:12
  • All fields from the history table only. I was hoping to use the settings table to find records.
    – Harley
    Commented Oct 12, 2017 at 17:13

1 Answer 1

2

For SFMC you need to use JOINs (visual ref) to query multiple tables. With Joins, you need to use an 'ON' statement to signify what is the unique key to combine the two tables(or DEs in this case).

Below should do it for your needs:

SELECT hi.*

FROM History hi

INNER JOIN settings se

ON se.Number = hi.Number
WHERE se.ID = 1
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .