Skip to content

query for join two column and get one row per left with column that have array of right table refrenced to left table row

hellow.I have a tablt product like this

and shirt_color table:

I want to write a query to get all products and its colors (but all colors in one array column) like this below :

Advertisement

Answer

use GROUP_CONCAT:

User contributions licensed under: CC BY-SA
4 People found this is helpful