Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have a table containing these information
Num , Value
1 , A
1, B
2 , V
3, A
3 , D
4 , E
I would like to create a table with the following fields
Num Value
1 , A|B
2 , V
3 , A|D
4 , E
any idea ?
The data source is an SQL server 2008 Database.
Thanks for your help
Philippe
Hi Philippe,
You might want to look at using the Concat() function. Here's an inline example based on your data:
T1:
LOAD * INLINE [
Num , Value
1,A
1,B
2,V
3,A
3,D
4,E
];
NoConcatenate
T2:
Load
Num,
Concat(Value,'|') as Value
Resident T1
Group by Num;
Drop table T1;
Hi Philippe,
You might want to look at using the Concat() function. Here's an inline example based on your data:
T1:
LOAD * INLINE [
Num , Value
1,A
1,B
2,V
3,A
3,D
4,E
];
NoConcatenate
T2:
Load
Num,
Concat(Value,'|') as Value
Resident T1
Group by Num;
Drop table T1;
Thanks a lot.
I always forgot that function.
That works perfectly,
Philippe