Split field by Comma

Gnaniyar's Avatar, Join Date: Jan 2009
Newbie Member
Hi all,

i want to split field by comma. For example,

primarySkills

20553, 32115, 78546

i have this field as id. it may contain 4 or 5 or above that. i want to retrive these in different columns by splitting comma.

i want ouput like this: ( if 3 values = 3 column or 4 values = 4 column)

primarySkills primarySkills primarySkills

20553 32115 78546

Thanks in advance.

- Gnaniyar Zubair
Bhullarz's Avatar
Skilled contributor
Quote:
Originally Posted by Gnaniyar View Post
Hi all,

i want to split field by comma. For example,

primarySkills

20553, 32115, 78546

i have this field as id. it may contain 4 or 5 or above that. i want to retrive these in different columns by splitting comma.

i want ouput like this: ( if 3 values = 3 column or 4 values = 4 column)

primarySkills primarySkills primarySkills

20553 32115 78546

Thanks in advance.

- Gnaniyar Zubair
I think PHP's explode function can help you in this.