New answers tagged sql
0
votes
Export results from Query Studio in excel file or SFTP
In the results, there should be a "Export in Contact Builder" option on top of the columns that will link you to the temporary data extension, from which you can export.
0
votes
Query Returning Duplicates
De-dup the query using ROW_NUMBER() OVER (PARTITION BY s.SubscriberKey ORDER BY s.EventDate desc) as rn
0
votes
validate cloudpage data
I would suggest you create an additional handler page (also a Cloudpage) to check and progress data.
In the main Cloudpage: put handler page URL in the "form action" with the POST method so ...
0
votes
How to get specific number of email send within a time
The logic was correct, you had only the wrong Source DE for the grouping. Since you want to find subscribers who received at least 13 emails then we need to group not _Subscribers Data View but _Sent ...
0
votes
case : check if field A exist in field B
You do not need to overcomplicate it with a subquery in the CASE-WHEN statement, it is enough to simply compare two fields like that -
SELECT
Id,
Email_source1,
Email_source2,
CASE
WHEN ...
1
vote
Hi, does anyone know where is the error of this query?
The respective field for JBActivityID in _SMSMessageTracking is ActivityID in _JourneyActivity not JourneyActivityObjectID
So it should be like this:
SELECT
smt.SubscriberKey,
smt.CreateDateTime AS ...
1
vote
Any suggestions on better or optimized approach that returns single row from multiple rows based on ROW_NUMBER in SFMC
Since the relevant data is already available in the inner select, the join is unnecessary. Regarding performance, the camps are rather split between join vs sub-queries, until there is data to prove ...
2
votes
Accepted
Dynamic SQL Top() clause in SFMC
Nice solution by Adam.
a different alternative I sometimes use is to store the "TOP" number in a control table with key/value pairs, and look it up based on some condition (e.g. id could be ...
3
votes
Dynamic SQL Top() clause in SFMC
You could do use the row_number() window function to assign a sequential number to each row (in random order) and then only select rows that less than or equal to your volume value. Something like ...
0
votes
Recommended approach for coupon assignment in SFMC?
I had this same issue with ClaimRow(), and the recommendation from experienced specialists was to not use it.
The recommended approach was to use the tried-and-true SQL JOIN merge between the ...
1
vote
Accepted
Combining 3 SQL Queries into a Single Query
I'd suggest that you build a simple model outside of Marketing Cloud first -- instead of trying match counts. It's easier to look at the data and determine the desired outcomes before writing the ...
Top 50 recent answers are included
Related Tags
sql × 935marketing-cloud × 872
automationstudio × 262
query × 233
dataextensions × 186
data-views × 63
journeybuilder × 50
automation × 34
sqlserver × 29
ampscript × 26
data × 26
soql × 22
ssjs × 20
email × 14
database × 14
marketing-cloud-connect × 13
date × 13
subscriber × 12
apex × 10
datetime × 10
sfmc-business-unit × 10
sql-studio × 9
activity × 7
reporting × 6
error-messages × 6