/************************* 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) */