Пожалуйста, попробуйте это
;WITH CTE(Cust_id,ID,[Date ])
AS
(
SELECT 75407014,603,'2018-04-27' UNION ALL
SELECT 79807014,603,'2018-04-30' UNION ALL
SELECT 75407016,604,'2018-04-23' UNION ALL
SELECT 79807016,604,'2018-04-30' UNION ALL
SELECT 75407018,605,'2018-04-24' UNION ALL
SELECT 79807018,605,'2018-04-30' UNION ALL
SELECT 75407020,606,'2018-04-24' UNION ALL
SELECT 79807020,606,'2018-04-30' UNION ALL
SELECT 75407014,608,'2018-04-27'
)
,CTE_Final
AS
(
SELECT Cust_id
,ID
,[Date ]
,DENSE_RANK()OVER(ORDER BY ID) SEQ
FROM CTE
)
SELECT Parent_id
,Child_id
FROM
(
SELECT SUBSTRING(Cust_id,0,CHARINDEX(',',Cust_id)) AS Parent_id,
SUBSTRING(Cust_id,CHARINDEX(',',Cust_id)+1,LEN(Cust_id))AS Child_id
FROM
(
SELECT DISTINCT STUFF((SELECT DISTINCT ', '+CAST( Cust_id AS VARCHAR(10))
FROM CTE_Final i WHERE i.SEQ=o.SEQ
FOR XML PATH ('')),1,1,'') AS Cust_id
FROM CTE_Final o
)dt
)Dt2
WHERE Dt2.Parent_id <> ''
ORDER BY Parent_id
Результат
Parent_id Child_id
--------------------
75407014 79807014
75407016 79807016
75407018 79807018
75407020 79807020