Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [sql]

Structured Query Language (SQL) is a domain-specific language used in programming and designed for managing data held in a relational database management system (RDBMS), or for stream processing in a relational data stream management system (RDSMS)

0
votes
1answer
43 views

How to send an email, three days before birthday using SQL query in salesforce marketing cloud?

I am new to salesforce marketing cloud. How to send an email, three days before birthday date using SQL query or using data filter Automation studio. Could anybody please help me.
0
votes
1answer
15 views

Write to LIST from a DATA EXTENSION

I am trying to pull subscriber information from a Data Extension, and then add it into a custom list. I understand that the ideal process is to create a data extract, then import the CSV into the ...
0
votes
0answers
18 views

How to get my all records with null records using SQL query in salesforce marketing cloud

I have created one 'TEST' Data extension using Email and FirstName fields which are not primary fields. In this data extension have three records one is null record. Now my requirement is how to get ...
1
vote
3answers
68 views

SQL multiple WHERE clause problem

I have a SQL query that puts records from one DE to another DE if that record does not exists in the second DE. The base works fine for me and i have the following query: select t.Emailaddress from [...
0
votes
1answer
37 views

Is it possible to write a SQL Query to extract send data that includes Tags and/or Campaign names

We are trying to do some reporting based on emails with specific tags or associated to specific campaigns over the past 12 months. I have tired to use the Analytics builder > Reports to get the data ...
2
votes
3answers
42 views

Optimize a query that is timing out

I have two data extensions that I need to join and filter. One stores member data for a product, the other stores opt-in status for all products. The DE with opt-in status can have multiple instances ...
0
votes
1answer
21 views

Marketing Cloud - Does table exist

I'm looking for a way, using SQL, to see if a table exists for any random given name I've tried creating a simple "Select * from MyRandomTableName" but this doesn't work in Marketing Cloud as i need ...
0
votes
1answer
24 views

Remove Special Characters SQL

I am currently trying to run an SQL qeuery that strips out special characters and then adds a '1' in front to have all numbers correctly formatted. For what ever reason my REPLACE doesn't seem to work ...
0
votes
0answers
8 views

Trying to query the _open and click tables to fill a new table with the email of the users who have opened or clicked a link in an email

I'd like a query to pull from a specific email which is in content builder. What would my query look like? Also what columns are needed for the target Data Extension?
0
votes
0answers
17 views

Pulling every email job an email address has ever received

I am looking to pull all the email jobs that a particular email address has received. The issue is our transactional unit uses email as a the subscriber key and our promotional unit uses unique ...
1
vote
1answer
28 views

SQL Won't Populate Salesforce Data Extension

I am trying to dump data from a Salesforce object into a Salesforce Data Extension. I am not getting an errors but the data refuses to populate. I can't figure out what I am doing wrong! I have tried ...
0
votes
1answer
23 views

Anonymous Execution: System.LimitException: Too Many DML Statements: 151

I am trying to run the following piece of code to update all Accounts without a primary contact. This method will look through all contacts of an account and assign the first contact it reads to be ...
0
votes
1answer
30 views

How to display Month in TEXT format using SQL query in marketing cloud?

I create one Data Extension name is 'TEST' using Day, Month and Year fields. I have done this scenario in number format. But I need to Display Month in Text format. How is it possible? please anybody ...
0
votes
1answer
24 views

How to separate The Day, Month and Year attributes using SQL _Open query in salesforce marketing cloud?

I have creating TestDE Data extension using these attributes like SubscriberKey, AccountID, EventDate, Date, Month, Year attributes. And Created with same attributes using Target Data extension. Now ...
1
vote
1answer
31 views

Generic System Error when I use a Left Join

I'm creating an automation that uses a series of SQL queries to identify people who were potentially targeted for a dynamic content block in an email, determine if they were included in a job that ...
1
vote
0answers
19 views

Left Join query

I'm trying to left join a table in Marketing Cloud Automation Studio Query. I don't receive any errors but the expected data is not pulling into the data extension. The bolded statements are what are ...
2
votes
1answer
28 views

Find a count of clicks per subscriber and LinkName

I'm in the process of building a query that will give me a count of all links a subscriber has clicked on with one of three aliases. The possible alias's are "watch", "win", and "play". I've written ...
0
votes
1answer
43 views

Simple query troubleshooting

I have a simple query that is erring out. I cannot figure out why, as it is so simple. The target data extension has a primary key on contact_key. Both fields (unsubscribe & newsletter) from ...
0
votes
1answer
33 views

Query Activity for suscribers that opened campaigns

We want to get a Data Extension with only de emails of subscribers that opened certain JobIDs. I ran this SQL Activity but the targeted Data Extension shows 0 records after it finished running. What ...
0
votes
1answer
24 views

SFMC SQL query to update related records

Scenario: I need to update all children from a family based on the values populated from a single child. So if Child A has a city of 'London' for example, I would want Child B and C to have 'London' ...
0
votes
0answers
14 views

How to measure responses to a content block used in multiple sends

I have a saved piece of content that I have used in dynamic content blocks in multiple emails. I want to measure the opens and clicks that the content received to see how effective it was. What's the ...
0
votes
1answer
27 views

Extracting Open counts from Data Views and match against Salesforce Account ID's

I would like to extract my Opens into a statistics table that contains columns like Last Opened 7 Days. To achieve this I am using the Data Views to query out the _opens table. The target Data ...
0
votes
2answers
50 views

Does IsUnique in the _Click data view dedupe subscribers over multiple jobs?

I want to write a SQL query that will find the total clicks and unique clicks for 1 URL across multiple email sends. Total clicks is easy, but I'm not sure about the unique clicks. I want to basically ...
0
votes
1answer
14 views

Last updated date on custom data extension created in salesforce marketing cloud

I've created a data extension in marketing cloud based on sql query. I update this data extension manually on need basis (usually one or two times in a month). Logic for data extension - 1. Data ...
1
vote
1answer
333 views

SAQL vs SOQL vs SOSL vs SQL? [closed]

I have recently come across SAQL and I'd like to understand the differences between all the different ways to query against Salesforce APIs. The new einstein branding is too complex to get my head ...
0
votes
1answer
56 views

How to write a simple SQL query to identify records who have been sent an email

I'm a Marketing Cloud SQL beginner and I've been struggling to find a simple reference to a SQL query that shows how to identify records who were Sent a particular email. I landed on the following ...
5
votes
2answers
134 views

Allow simultaneous writes to the same Data Extension

I have a use case where I need to bring _PushAddress data from 60 Business Units back to the Global Business Unit. For information _PushAddress has a restricted view of data available in a single ...
0
votes
0answers
60 views

How to write an sql query in marketing cloud if field name contains a reserved string?

I'm using marketing cloud for sending various marketing communication. SFMC is integrated with sales cloud. I'm facing a problem while creating a data extension which contains a field name contains ...
0
votes
1answer
44 views

SQL Convert String to Integer

In our Marketing Cloud instance we have a column that is a string and needs to be converted to an integer. I have tried the following query but get the following error: Query: UPDATE TableName ...
3
votes
1answer
56 views

False matches in a SQL query activity

I am trying to automate updates to the All Subscribers list whenever the preferred e-mail in Salesforce changes. I created a SQL query activity that compares our Salesforce data extension to the e-...
1
vote
2answers
45 views

Marketing Cloud -SQL Group BY

I have a table and I need to run some calculations on it for reporting purposes. I want to add a row that measures counts by that month. And I'm attempting to use the following statement: SELECT ...
0
votes
2answers
59 views

Very basic _click query not working

I have a very basic _click query like this: SELECT SubscriberKey FROM _Click WHERE LinkName = 'XXX' OR LinkName = 'XXX' OR LinkName = 'XXX' The XXX are ofcourse dummy text but in my query i have ...
0
votes
1answer
48 views

Querying ActivityName in _JourneyActivity data view returns no results

My brain is breaking. I have journeys deploying emails in my Salesforce Marketing Cloud instance. According to all of Salesforce's documentation (specifically this page), I should be able to query ...
0
votes
1answer
43 views

SQL Statement to merge two tables with multiple records

I'm trying to merge two objects using Automation Studio in Marketing Cloud so a customers opportunities/or no opportunities are all in the one table. I think this spreadsheet i created will make ...
0
votes
1answer
41 views

Inserting a value into a field in a Data Extension where records match on a key in Salesforce Marketing Cloud

Please excuse my ignorance, as this seems like a simple thing. I'm just new to to SQL and am having trouble working it out. I have a data extension of records with a blank Variable field. I have a ...
1
vote
1answer
56 views

How to de-duplicate SQL query using ROW_NUMBER

I try to de-deduplicate my SQL Query but it gives this error: An error occurred while checking the query syntax. Errors: An error occurred while checking the query syntax. Errors: Invalid column ...
1
vote
1answer
43 views

Update Data Extension via WSProxy

I've built a CloudPage which runs SQL queries quickly without having to use automation studio. The SSJS that runs the query works perfectly, but I'm also trying to use this function to also update a ...
0
votes
2answers
46 views

Rewrite query to make it without subqueries

I have some custom objects displayed on schema. I need return vacancies which have last active interview at least week ago. I have some query: List<Vacancy__c> ids = new List<Vacancy__c>(...
0
votes
1answer
21 views

Multiply two fields if an ID is found in a separate table

Trying to create a Data Extension where we calculate the total spend in a category, if the category exists in a list of promotional categories. The point is that we want to provide an offer when a ...
0
votes
2answers
61 views

Marketing cloud Query Single field split into multiple fields

I have a data extension that has duplicate email addresses with each duplicate having a different rank associated with it. I need to dedupe the email addresses but keep the different ranks in added ...
0
votes
1answer
112 views

SQL Query to pull only Hard Bounces?

I currently manually update a database by exporting bounced email addresses using the code below: SELECT DISTINCT UPPER(EmailAddress) as EmailAddress, SubscriberKey FROM _Subscribers WHERE Status = '...
1
vote
1answer
63 views

Boolean always showing True for Marketing Cloud SQL Query

I have a SQL query that is always returning true for my boolean field even though the data in SF is showing false. Incomplete_Runtime_Data__c is the boolean field, all other fields return correctly. ...
0
votes
1answer
27 views

How to select last order on SF Marketing Cloud?

I have a database consisting of over 1 million orders, I'm looking to select the last order (indicated by OrderDate) for a customer (indicated as CustomerID). Here's what I've tried so far: SELECT ...
0
votes
1answer
49 views

How to update a field in target Data Extension in marketing cloud

I wrote a query to update a field inside a target Data Extension. The query will set the field to True when a subscriber has received an email within three days. The field has a default value of False....
0
votes
1answer
37 views

Creating master data view with multiple data views

I am trying to create one master data extension for multiple different event types like clicks, bounces, opens, and etc. Is there any documentation that leads toward this? Or if I have to join all ...
0
votes
1answer
30 views

Is there any developer console sort of feature available to check & preview salesforce marketing cloud sql queries?

In marketing cloud while running a sql query, to check results I have to create a data extension and store results into it. I want to know if there is any alternative available through which we can ...
0
votes
2answers
33 views

Week Number, where week starts on Monday (not Sunday)

I'm trying to calculate the number of new subscribers, unsubscribes, held, etc, by week where the week starts on Monday and ends on Sunday. I can get the query to work fine when the week starts on ...
0
votes
1answer
33 views

Populating Data Extension Column from Existing Columns [closed]

I would like to populate a Data Extension Column from existing columns Say I have a Data Extension Like this FN | LN | FN LN Jack|Johns| Null Jane|Jones| Null Luke|Smith| Null FN and LN are ...
0
votes
2answers
36 views

Personalisation strings exact target

We are new to MC and would like to know if there is a way to query all the personlisation strings that exists in all our contents. We are still using classic content but looking 5o move to content ...
0
votes
1answer
26 views

Why is my code querying All Subscribers producing results that don't exist in All Subscribers?

In Marketing Cloud - I'm trying to write an SQL that will pull everyone who has opened an email in the last 90 days. I'm getting results from the below SQL, but when I spot-check the data, I'm finding ...