1

I am getting this result by using select query.

enter image description here

But what actually i want the result is for example:

| 23407 | 42 M-65 Giant jacket, Brandit | Size:L - colour:Olive   |
| 23417 | 42 M-65 Giant jacket, Brandit | Size:2XL - colour:Olive |
| 23413 | 42 M-65 Giant jacket, Brandit | Size:XL - colour:Black  |
Ghostman
  • 6,042
  • 9
  • 34
  • 53
Arsalan
  • 35
  • 6
  • 1
    Possible duplicate of [Can I concatenate multiple MySQL rows into one field?](http://stackoverflow.com/questions/276927/can-i-concatenate-multiple-mysql-rows-into-one-field) – DarkSquirrel42 Jan 11 '17 at 09:47
  • 1
    Yes, but I'd handle this kind of thing in application code – Strawberry Jan 11 '17 at 09:54
  • Please refer following link to achieve your result [Concatenate many rows into a single text string](http://stackoverflow.com/questions/194852/concatenate-many-rows-into-a-single-text-string) thanks! – Ramesh Jan 11 '17 at 09:57

1 Answers1

0

You probably want to use GROUP_CONCAT() of that att_name column group by the id_product column like

select *, GROUP_CONCAT(att_name) as att_name
from 
  ( 
      // your posted query as subquery 
  ) xxx
group by id_product
Rahul
  • 76,197
  • 13
  • 71
  • 125