New answers tagged

0 votes

Marketing Cloud SQL ORDER BY not working

Your question is very interesting, I confirm ORDER BY can only work with TOP NUMBER not TOP PERCENT. I guess the reason for this is that SFMC wants to control SQL performance with ORDER BY, that's why ...
user avatar
1 vote

Marketing Cloud SQL To Convert Epoch (string) to Date Time?

You might want to check this question: How to correctly convert Unix Timestamp to datetime in SQL A plain convert is not enough - you need to add the number from your string to epoch start date ('1970/...
user avatar
1 vote

SOQL: How to get the biggest value from a field and compare to a another on query?

SOQL, even though looks similar to traditional RDBMS SQL, it lacks many capabilities. Using fields on both of side expressions is one such feature SOQL doesn't support. For ex., you cannot do this ...
user avatar
  • 1,424
0 votes

Sql query to exclude related records in dataset

I think you can do that with a 'not exists' clause. Something like: SELECT a.email_address FROM [table] a WHERE NOT EXISTS ( SELECT TOP 1 email_address FROM [table] b WHERE b.product_code = 'A' ...
user avatar
  • 27.9k
0 votes

Query Question (automation failed due to system error)

That query studio error - "automation failed due to system error" shows up intermittently - Sounds dumb, but try the same query again. Also you can just build a quick target DE and try it in ...
user avatar
0 votes
Accepted

ERROR: Query failed: Timeout in automation studio

I'd just split it at the join level. First query is an overwrite on the target DE. Second and third queries are updates. Query 1 - Opportunity select Opp.Id AS OpportunityId , Opp....
user avatar
  • 27.8k
0 votes

String to Date in SQL

It sounds like the data set you're trying to import has malformed dates if some of the rows loose their data and some dont. If you're unable to get a new file with correct dates or if the files are ...
user avatar
  • 66
1 vote
Accepted

Retrieve data from synchronised data extension to a sendlog data extension

In the case those values are not stored in your SendLog, rather in the Synchronised Data Extensions, you have to change the table prefixes and the join logic. Try something like this: select sl....
user avatar
  • 10.3k

Top 50 recent answers are included