I'm trying to create a samples DE of records from the deployment audience, but I'm having trouble making sure all people get all possible values that the email could display. Using the code below I get one test record with final data for each seed recipient, whereas I should get at least 5 (since there are 5 possible values for the variable I'm sorting by).
Can anyone help?
SELECT
my_recips.email_address1,
my_recips.piv_key,
my_data.campaign_id,
my_data.wave_id,
my_data.me_key,
my_data.split_code
FROM (
SELECT
'[email protected]' AS email_address1,
'[email protected]' AS piv_key,
NULL AS me_key
UNION
SELECT
'[email protected]' AS email_address1,
'[email protected]' AS piv_key,
NULL AS me_key
UNION
SELECT
'[email protected]' AS email_address1,
'[email protected]' AS piv_key,
NULL AS me_key
UNION
SELECT
'[email protected]' AS email_address1,
'[email protected]' AS piv_key,
NULL AS me_key
UNION
SELECT
'[email protected]' AS email_address1,
'[email protected]' AS piv_key,
NULL AS me_key
) my_recips
CROSS JOIN (
SELECT *
FROM (
SELECT
*,
ROW_NUMBER() OVER (ORDER BY [SPLIT_CODE]) AS row_number
FROM
[FINAL LIST]
) sub
WHERE sub.split_code IN ('1','1L','2','2L',3)
) my_data