i'm trying join multiple table single row result each id. result send angular ui
i have 3 tables user
, friends
, trip
user
can have multiple friends
1 trip
i details corresponding user in 1 row, friends
field array?
this how table looks.
group_concat
should trick you:
select u.*, t.*, friendlist user u left join trip t on u.id = t.user_id left join (select user_id, group_concat(concat (name, '- ', email)) friendlist friends group user_id) f on f.user_id = u.id
Comments
Post a Comment