首页 文章

sqlite alter table在单个语句中添加MULTIPLE列

提问于
浏览
134

是否可以在sqlite中的单个语句中更改表添加MULTIPLE列?以下不起作用 .

alter table test add column mycolumn1 text, add column mycolumn2 text;

2 回答

  • 263

    不,你必须一次添加一个 . 请参阅SQLite's ALTER TABLE documentation顶部的语法图:

    ALTER TABLE syntax

    ADD 分支中没有循环,因此不允许重复 .

  • -13

    alter table test add column mycolumn1 text; alter table test add column mycolumn2 text;

    使用上面的redifined查询

相关问题