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.
我想从 select 语句插入表,但是,从 select 语句返回 3 列,表有 4 列,我想为额外列中的所有行添加 0。谁能给我一个示例 SQL 查询?
谢谢!
只需在您的选择中添加“0”即可。
INSERT INTO table_name (a,b,c,d) SELECT other_table.a AS a, other_table.b AS b, other_table.c AS c, '0' AS d FROM other_table
在 SQL 中将 0 作为默认值或将 0 添加到您的表区域
只需选择“0”作为所需列的值