In mysql db table I have projects with one to many relation with domain table like
projects
----------------
proId | domainId
----------------
1 1
1 2
2 1
3 3
domain
---------------------
domainId | domainName
---------------------
1 Web
2 Mobile
3 iPhone
I query
SELECT p.*, d.* FROM projects p LEFT JOIN domain d ON p.domainId = d.domainId
which results
result
-----------------------------
proId | domainId | domainName
-----------------------------
1 1 Web
1 2 Mobile
2 1 Web
3 3 iPhone
but is it possible to show all domains as single value with concatenation some thing like
-----------------------------
proId | domainId | domainName
-----------------------------
1 1, 2 Web, Mobile
2 1 Web
3 3 iPhone
probably you are looking for
GROUP_CONCATfunction.SQLFiddle Demo