0

I have a MySQL table called mst_order_details and it has column (order no) and it can be same order no it more time.

Each order number have related technique column I want to concat technique column according to order no

mst_order_details table :

order no   Technique
-------------------------
1           heat_seal
1           laser_cut
1           oil_filter
2           diamond cut
2           diamond cut

Output should be like this :

order no    Technique
---------------------------------------------
 1          heat_seal/laser_cut/ oil_filter
 2          diamond cut
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Hasitha
  • 129
  • 1
  • 11
  • post your database structure, need more explaination – Prateik Darji Dec 05 '17 at 09:18
  • Please read [How do I ask a good question?](https://stackoverflow.com/help/how-to-ask) and [What topics can I ask about here?](https://stackoverflow.com/help/on-topic). Research, try something, add your code & point your problem. Pay attention to formatting question – pirho Dec 05 '17 at 09:19

1 Answers1

3

You can use GROUP_CONCAT:

SELECT `order no`, GROUP_CONCAT(DISTINCT `Technique` SEPARATOR '/') FROM mst_order_details GROUP BY `order no`;
Andrey Yerokhin
  • 273
  • 1
  • 7