MySQL中的表复制
目标表不存在时
CRATE TABLE dest_table_name(SELECT column_name,… FROM src_table_name);
目标表存在时
INSERT INTO dest_table_name(SELECT column_name,… FROM src_table_name);
Oracle中的表复制
目标表不存在时
CREATE TABLE dest_table_name AS SELECT column_name,… FROM src_table_name;
说明:
用子查询创建新表时,只有非空约束会被带到新表中,即:only NOT NULL constraints is copied .
目标表存在时
INSERT INTO dest_table_name(column_name,…) SELECT column_name,… FROM src_table_name;
Post a comment now »
本文目前不可评论
Sorry, the comment form is closed at this time.
No comments yet.