sql SFMC - 电子邮件域的SQL查询数据扩展

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sql SFMC - 电子邮件域的SQL查询数据扩展相关的知识,希望对你有一定的参考价值。

/************************* USE CASE **************************/ 
/*** YOU NEED TO IMPORT A LIST OF SUBSCRIBER KEYS IN SFMC ***/
/*** AND YOU NEED TO PROVIDE A COUNT PER SPECIFIC DOMAINS RELATED TO KEYS INSERTED ***/

SELECT 
  'OUTLOOK'  AS DOMAIN,  
   COUNT(*)  AS COUNT, 
   GETDATE() AS LASTUPDATE
FROM (
    SELECT SRC.* 
    FROM [YOUR SOURCE DATA EXTENSION] SRC 
      INNER JOIN [YOUR MASTER DATA EXTENSION] MASTER  
              ON SRC.SUBSCRIBERKEY = MASTER.SUBSCRIBERKEY 
    WHERE MASTER.EMAILADDRESS LIKE '%@outlook.%'
       OR MASTER.EMAILADDRESS LIKE '%@hotmail.%'
       OR MASTER.EMAILADDRESS LIKE '%@live.%'
) row1

UNION

SELECT 
  'GOOGLE'   AS DOMAIN,  
   COUNT(*)  AS COUNT, 
   GETDATE() AS LASTUPDATE
   
FROM (
    SELECT SRC.* 
    FROM [YOUR SOURCE DATA EXTENSION] SRC 
      INNER JOIN [YOUR MASTER DATA EXTENSION] MASTER  
              ON SRC.SUBSCRIBERKEY = MASTER.SUBSCRIBERKEY 
    WHERE MASTER.EMAILADDRESS LIKE '%@gmail.%'
       OR MASTER.EMAILADDRESS LIKE '%@googlemail.%'
) row2

/* TECHNICAL SPECIFICATIONS:                                                                                                       */
/* YOUR SOURCE DATA EXTENSION = DATA EXTENSION WHERE YOU HAVE THE SUBSCRIBERS KEYS ONLY, FOR EXAMPLE                               */
/* YOUR MASTER DATA EXTENSION = YOU SOURCE OF TRUTH, WHERE YOU MAINTAIN THE SUBSCRIBER DATA                                        */
/* YOUR TARGET DATA EXTENSION = WHERE YOU GONNA SAVE THE RESULTS. MUST HAS 3 FIELDS: DOMAIN(text), COUNT(number), LASTUPDATE(date) */

以上是关于sql SFMC - 电子邮件域的SQL查询数据扩展的主要内容,如果未能解决你的问题,请参考以下文章

sql SFMC-SQL分割remainder.sql

sql SFMC-SQL地理distance.sql

sql SFMC-SQL创建,间二dates.sql

sql SFMC-SQL条次从 - dates.sql

sql SFMC-SQL排名,method1.sql

sql SFMC-SQL排名,method2.sql