Reputation: 115
In the column tutor, tutors can be duplicated but project numbers are unique. I need to get all tutors and all the project numbers they have.
for example I have:
column tutor column projects
Steve 1
Theo 2
John 3
Steve 4
And the result I need is:
Steve 1, 4
Theo 2
John 2
Upvotes: 0
Views: 286
Reputation: 11393
SELECT tutor, GROUP_CONCAT(projects SEPARATOR ',') AS projects_list
FROM your_table
GROUP BY tutor
Documentation: GROUP_CONCAT
Upvotes: 3