mysql - Group Concat in one column with multiple values -


i need print select values in 1 column, here data:

 mysql> select date_format(str_to_date(items.date, '%y-%m-%d'), '%m %d,  %y') date_new, unit, descpt, p_cost, add_by, group_concat(color,' = ',qty) color, sum(qty) total, sum(qty) * p_cost ptotal items status in ('1','2') group descpt;   +---------------+------+------------------------+--------+--------+-------           -------------------------------------------------------------------------------          --------------------------------------------------------------------------------     --+-------+--------+   | date_new      | unit | descpt                 | p_cost | add_by | color                                                                                                                                                                        | total | ptotal |   +---------------+------+------------------------+--------+--------+----      --------------------------------------------------------------------------------      --------------------------------------------------------------------------------      -----+-------+--------+   | june 16, 2016 | pcs  | #1688n - big crate new | 125.00 | psd    | blue - w = 200,blue - w/o = 400,red - w/o = 300,red - w = 500,green - w = 366,green - w/o = 278,yellow       - w = 472,yellow        - w/o = 582,black - w = 255,black - w/o = 330 |  3683 | 460375 |   +---------------+------+------------------------+--------+--------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+--------+ 

like sample:

sample


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -