开发者

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. :-)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜