I need some help, in my database I have a relation many to many, so I created an aux table to make 1 to many relationship, the tables are the next.
offices request request_x_offices
------- --------- ------------------
id id id_request
office_name name id_office
So when i do a query to request_x_offices
i get some like the next
request_x_offices
-----------------
id_request| id_office
-----------------
1 1
1 2
1 3
1 4
1 5
2 1
2 2
2 3 etc...
after I do a JOIN to replace the offices_id
by the name of the office and I get the next
id_request|office_name
-----------------
1 | office_name1
1 | office_name2
1 | office_name3
2 | office_name1
2 | office_name3
2 | office_name5
But I want to get something like the next.
------
id_request|office_name
1 |office_name1, office_name2, office_name3
2 |office_name1, office_name3, office_name5
I tried do a coalesce but I only get a single row with all the office_name of all the id's :(
Any help will be appreciated, thanks for you time guys.