MySQL - Select concatenate 2 values with 1 id -
for example, have table 'map':
map: id | place __________ 1 | 1 | b 2 | 2 | b 2 | c
what mysql query can use me have following results:
id | place __________ 1 | a,b 2 | a,b,c
you should use group_concat() function this. can use follows.
select id,group_concat(distinct place order place asc separator ',') map group id
Comments
Post a Comment