开发者

Update query problem (SQLite for iPhone SDK)

开发者 https://www.devze.com 2023-01-26 12:29 出处:网络
I have a table column containing name of images (e.g Apple.jpg). All image names have .jpg as extension.

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

精彩评论

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