开发者

Using Sqlite3, create a slug version of a full title

I have a sqlite3 database table. I added a column called title_slug. I want to开发者_如何学Go take the contents of title column, and update the new title_slug column with a slug version. Can I do this straight from sqlite3 or do I have to code it outside of the program?


first of, there are no loops in SQLite. A not very generic solution could be:

UPDATE mytab SET title_slug = replace(replace(title_slug, ' ', '-'), '!', '')

but you would have to add many chars to replace ?!

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜