mercredi 27 mai 2015

Script to concatenate columns and remove leading/trailing delimiter

I have a table like this and I want to return concatenated strings where the column values are in ('01', '02', '03', '04', '99'). Plus the values will be delimited by a ';'. So row 1 will be 01;04, row 3 will be 01;02;03;04 and row 5 will simply be 01. All leading/trailing ; should be removed. What script would do this successfully?

R_NOT_CUR   R_NOT_CUR_2 R_NOT_CUR_3 R_NOT_CUR_4
01          NULL        04          NULL
98          56          45          22
01          02          03          04
NULL        NULL        NULL        NULL
01          NULL        NULL        NULL

Aucun commentaire:

Enregistrer un commentaire