GROUP_CONCAT
を使用します
SELECT a.data,
a.rowNumber,
GROUP_CONCAT(b.rowNumber)
FROM DuplicateRows AS a
INNER JOIN DuplicateRows AS b
ON a.data = b.dataAND a.Id != b.Id
GROUP BY a.data, a.rowNumber
GROUP_CONCAT
を使用します
SELECT a.data,
a.rowNumber,
GROUP_CONCAT(b.rowNumber)
FROM DuplicateRows AS a
INNER JOIN DuplicateRows AS b
ON a.data = b.dataAND a.Id != b.Id
GROUP BY a.data, a.rowNumber