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

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -