I am performing a SQL query in Automation Studio and I want the following:
Populate a data extension with ID of the Account_salesforce table with the ListName (Lists) bound to the ID of the first table.
For example: Has Account.Id that has Many Lists.
In my searches I only found something close to what I want to do using PIVOT, but the Cloud Marketing SQL is not supported.
Below is my query.
SELECT Account.Id AS 'ID SF' , ls.listName AS 'List' FROM _ListSubscribers AS ls LEFT JOIN [Account_Salesforce] AS Account ON Account.PersonEmail = ls.EmailAddress AND Account.name = ls.SubscriberKey WHERE ls.listName IN ('List_1' ,'List_2') GROUP BY Account.Id, ls.EmailAddress,ls.listName