Mysql
 sql >> Database >  >> RDS >> Mysql

Unisciti a un'intera tabella come riga singola

Usa un Cross Join e group_concat .

Interroga

select t1.name,group_concat(distinct t2.color separator ',') as color
from tbl1 t1,tbl2 t2
where t1.name = 'Paul'
group by t1.name;

SQL Fiddle