I have table structures as follows
table-1
-------
id
name
table-2
--------
imageId
id ( reference of table1.id)
image
and table1 has the following record
id name
1 A
2 B
3 C
Table 2 has
imageId id image
1 1 image1.jpg
2 1 image2.jpg
3 2 image3.jpg
i.e, table1.id has many images in table2, now i need to select the record and its corresponding images(multiple images for same id), like
id name image
1 A image1.jpg,image2.jpg
2 B image3.jpg
You can use the
GROUP_CONCATfunction to get values across multiple rows into a single comma-delimited string (such as how you have in your example desired result):