sql - MySQL Contact multiple right joined rows into one column -
if have this
users
id user 1 john 2 tom and
states
user_id state 1 ma 1 ca 2 va how result set is:
id user states 1 john ma,ca 2 tom va i think has group contact, can't work.
as suggested, group_concat way go - need group by users' columns:
select u.id, u.user, group_concat(s.state) users u join states s on u.id = s.user_id group u.id, u.user
Comments
Post a Comment