Lets assume that I have Table which contains Username and the other one which contains FirstName. A single user can have multiple FirstNames:
How can I obtain a record which will contain Username and all first names separated by comma?
i. e.
Users
id | Username
1 | Test
Names
UserId | FirstName
1 | Mike
1 | John
I would like to receive a record which will contain
Test, "Mike, John"
How can I do that?
Edit: What if Users table will have more columns which I want to get?
i. e.
id | Username | Status
1 | Test | Active
How to get Test, Active, "Mike, John"
?