Update query problem (SQLite for iPhone SDK)
I have a table column containing name of images (e.g Apple.jpg). All image names have .jpg as extension.
How do开发者_Go百科 I update the extension from .jpg to .png using update statement of SQLite?
Thanks!
UPDATE mytable
SET name = substr(name, 1, length(name) - 4) || '.png'
WHERE name LIKE '%.jpg'
Of course, this won't convert the images themselves from JPEG to PNG. (Just to be sure. :-)
精彩评论