1.临时表CREATE TEMPORARY TABLE test2( id INT ) SELECT *FROM test2 SHOW TABLES; INSERT INTO test2 VALUES() DROP TABLE test2 2.复制表结构(先show create table test 获取 sql,然后用sql创建新表) 3.复制表的数据到新创建的表INSERT INTO test2 SELECT *FROM test
Sql Server(sybase): 1.复制表结构: 新建表student2,并且结构同表syn_xj_student一致.Sql语句如下: 2.复制表数据,并排除俩表中相同的数据: insert into syn_xj_student2 select * from syn_xj_student where f_id not in (select f_id from syn_xj_student2) mysql: 1.复制表结构: create table topic like bbs_to
1.不同用户之间的表数据复制 对于在一个数据库上的两个用户A和B,假如需要把A下表old的数据复制到B下的new,请使用权限足够的用户登入sqlplus:insert into B.new(select * from A.old); 如果需要加条件限制,比如复制当天的A.old数据insert into B.new(select * from A.old where date=GMT); 蓝色斜线处为选择条件 2.同用户表之间的数据复制 用户B下有两个表:B.x和B.y,如果需要从表x转移数据到