I have a few fields holding paths to images. I now want to add another field holding the image name. How can I extract the file name from the full path from another field and update the name into th开发者_运维百科e new field?
this is how i want it to look:
fields:
image_thumbnail | image_name
values:
http://mysite.com/images/thumbnail/1234.jpg | 1234.jpg
note: image names may have different file extensions
UPDATE your_table
SET image_name = SUBSTRING_INDEX(image_thumbnail, '/', -1)
;
精彩评论