GROUP_CONCAT(fieldname ORDER BY fieldname ASC SEPARATOR ',')
Full code usage example:
SELECT email, studentname, GROUP_CONCAT(matrixno ORDER BY matrixno ASC SEPARATOR ',') AS matno, COUNT(email) AS NumOccurrences FROM users GROUP BY email HAVING ( COUNT(email) > 1 )
Code above used to find duplicates for email.
0 Comments.