I have a simple table like this:
normally a select would look something like:
etc.. What i'm trying to do is get select results with the labels on one line like..
since this is 4.0.x I can't use the GROUP-CONCAT
best i've got so far that doesn't work (only retrieves 1 label per line) is:
Appreciate any thoughts..
Code:
ID int
label varchar
normally a select would look something like:
Code:
1 A
1 B
1 C
2 A
2 B
3 C
4 D
4 E
5 B
5 D
etc.. What i'm trying to do is get select results with the labels on one line like..
Code:
1 A B C
2 A B
3 C
4 D E
5 B D
since this is 4.0.x I can't use the GROUP-CONCAT
best i've got so far that doesn't work (only retrieves 1 label per line) is:
Code:
create temporary table B
select distinct ID, REPEAT(' ',255) as NewLabel
from A;
update B B1, A A1
set B1.NewLabel=TRIM(concat(TRIM(B1.NewLabel),' ',A1.label))
where B1.ID=A1.ID
select *
from B1
Appreciate any thoughts..