日期:2014-05-17  浏览次数:20804 次

create table的小问题,在线等
1 create table a as select * from emp where 1=2;
2 insert into a select * from emp where sal>2000;
3 复制表不能复制表的约束
4 如果只复制表的结构不复制表的数据则

这上面的几句如何理解呀,在线等 thanks

------解决方案--------------------
1:复制表结构。不带数据
2:把薪水大于2000的导入a 表。
3:约束不能复制的。要在新表a上新建。
4:create table a as select * from emp 数据和表同复制
------解决方案--------------------
1 create table a as select * from emp where 1=2;------只复制表,不包括数据
2 insert into a select * from emp where sal>2000; 把SAL大于2000的数据插入到A
3 复制表不能复制表的约束 --------复制的时候,约束需要手工建,复制不过来
4 如果只复制表的结构不复制表的数据则

------解决方案--------------------
1 create table a as select * from emp where 1=2;------只复制表,不包括数据
2 insert into a select * from emp where sal>2000; 把SAL大于2000的数据插入到A
3 复制表不能复制表的约束 --------复制的时候,约束需要手工建,复制不过来
4 如果只复制表的结构不复制表的数据则执行这句
  create table a as select * from emp where 1=2;


------解决方案--------------------
探讨

1 create table a as select * from emp where 1=2;------只复制表,不包括数据
2 insert into a select * from emp where sal>2000; 把SAL大于2000的数据插入到A
3 复制表不能复制表的约束 --------复制的时候,约束需要手工建,复制不过来
4 如果只复制表的结构不复制表的数据则执行……