Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 sqlite3 数据库表。我添加了一个名为 title_slug 的列。我想获取 title 列的内容,并使用 slug 版本更新新的 title_slug 列。我可以直接从 sqlite3 执行此操作,还是必须在程序之外对其进行编码?
首先,SQLite 中没有循环。一个不太通用的解决方案可能是:
UPDATE mytab SET title_slug = replace(replace(title_slug, ' ', '-'), '!', '')
但是您必须添加许多字符来替换?!