Go4Expert

Go4Expert (http://www.go4expert.com/)
-   MySQL (http://www.go4expert.com/forums/mysql-forum/)
-   -   Split field by Comma (http://www.go4expert.com/forums/split-field-comma-t15959/)

Gnaniyar 27Jan2009 16:34

Split field by Comma
 
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 25Mar2009 14:19

Re: Split field by Comma
 
Quote:

Originally Posted by Gnaniyar (Post 42047)
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.


All times are GMT +5.5. The time now is 16:57.