Reputation: 1523
i want back ids duplicate from mysql this is my query
> SELECT COUNT(title) AS duplicate_Count , title , id
> FROM lyric
> GROUP BY title
> HAVING COUNT(title) > 1
and result is this:
duplicate_Count title id 2 text 121 3 text_2 233
But I'd like this result:
duplicate_Count title id 2 text 121 , 122 3 text_2 233 ,260 ,56
any help please
Upvotes: 1
Views: 81
Reputation: 2707
Change id
to GROUP_CONCAT(id)
:
SELECT COUNT(title) AS duplicate_Count , title , GROUP_CONCAT(id)
FROM lyric
GROUP BY title
HAVING COUNT(title) > 1
Upvotes: 2