[英]Copy rows from source table to new table given condition
I use the following code but the program gives out an error and does not work: 我使用以下代码,但该程序发出错误,但不起作用:
INSERT INTO dest
SELECT *
FROM source
WHERE source.var="value";
I want to copy all rows and columns from the source table into the destination table given a condition. 我想在给定条件的情况下将源表中的所有行和列复制到目标表中。 How do I solve this?
我该如何解决这个问题?
Try this query using SELECT INTO . 使用SELECT INTO尝试此查询。 It will create new table and add rows to it.
它将创建新表并向其添加行。
SELECT *
INTO dest
FROM source
WHERE source.var="value";
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.