1、不同表之间的数据复制(两个表已经存在)
insert into table1(field1, field2, filed3) select col1, col2, col3 from table2 where oid = ‘XX’;
要求两个表必须存在。
2、同一表复制
insert into table1 select oid col1, col2, col3 from table1 where oid = ‘XX’;
3、不同表之间复制数据,并根据复制的数据创建新表
select col1, col2 into table2 from table1
此时table1存在,table2不存在,根据table1中的列定义创建table2.
insert into table1(field1, field2, filed3) select col1, col2, col3 from table2 where oid = ‘XX’;
要求两个表必须存在。
2、同一表复制
insert into table1 select oid col1, col2, col3 from table1 where oid = ‘XX’;
3、不同表之间复制数据,并根据复制的数据创建新表
select col1, col2 into table2 from table1
此时table1存在,table2不存在,根据table1中的列定义创建table2.
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10712951/viewspace-1208816/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/10712951/viewspace-1208816/