Is it possible to alter table add MULTIPLE columns in a single statement in sqlite? The following would not work.
是否可以在sqlite的一个语句中添加多个列?以下是行不通的。
alter table test add column mycolumn1 text, add column mycolumn2 text;
2 个解决方案
#1
249
No, you have to add them one at a time. See the syntax diagram at the top of SQLite's ALTER TABLE documentation:
不,你必须一次加一个。参见SQLite的ALTER TABLE文档顶部的语法图:
There's no loop in the ADD
branch so no repetition is allowed.
添加分支中没有循环,因此不允许重复。
#2
-12
alter table test add column mycolumn1 text; alter table test add column mycolumn2 text;
修改表测试添加列mycolumn1文本;alter table test添加列mycolumn2文本;
use the above redifined query
使用上面的重拨查询
#1
249
No, you have to add them one at a time. See the syntax diagram at the top of SQLite's ALTER TABLE documentation:
不,你必须一次加一个。参见SQLite的ALTER TABLE文档顶部的语法图:
There's no loop in the ADD
branch so no repetition is allowed.
添加分支中没有循环,因此不允许重复。
#2
-12
alter table test add column mycolumn1 text; alter table test add column mycolumn2 text;
修改表测试添加列mycolumn1文本;alter table test添加列mycolumn2文本;
use the above redifined query
使用上面的重拨查询