MySql explode cell value

Is there a way to explode a cell value within a mysql statement

for example

("SELECT * FROM image_files WHERE details = 'Explode("-",details')Return array[2]'")

Hope that kinda makes sense. I want to explode the value in column details at the "-" and get the third value sent in the array as it would if using the php explode feature.

thanks,
walter
LVL 8
wal_toorAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
cmaohioConnect With a Mentor Senior Systems ManagerCommented:
the only other thing I can think of is through an elaborate use of the substring() or even substring_index()

http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_substring-index
0
 
cmaohioSenior Systems ManagerCommented:
MySQL doesn't have an explode function so you cannot do this. You will have to pull the data out of the database with one query, get the value through exploding the data, then do another query.
0
 
wal_toorAuthor Commented:
Ahh substring_index() did the trick for me. Thankz
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.