on 2018 Aug 23 1:50 AM
Hi experts,
I would like to know if its possible to concat rows in flexible search like this way:
from:
COLUMNA COLUMNB
F000000001 XS150170112P
F000000001 FT200180136P
F000000002 DT125170118P
to:
COLUMNA COLUMNB
F000000001 XS150170112P, FT200180136P
F000000002 DT125170118P
Request clarification before answering.
Hello Adán!
You can achieve that with GROUP BY statement and GROUP_CONCAT function like this:
SELECT {manufacturername}, GROUP_CONCAT(DISTINCT {name} ORDER BY {name} DESC separator ', ') FROM {product} GROUP BY {manufacturername}
In your example it would look like:
SELECT {COLUMNA}, GROUP_CONCAT({COLUMNB} separator ', ') FROM {your_table} GROUP BY {COLUMNA}
Hope this helps!
Regards, Pawel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.