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.
我想做这样的事情:
INSERT INTO table2 (col1, col2, col3 = 'constant literal') SELECT col1, col2 FROM table1;
所以 col1 和 col2 从 table1 复制到 table2,但 col3 设置为我想要的常量值。上面的代码不起作用。那么我该怎么做呢?我不想通过更改架构将默认值设置为 col3。
如果相关,我正在使用 sqlite3。
INSERT INTO table2 (col1, col2, col3) SELECT col1, col2, 'constant literal' FROM table1