`
tomotoboy
  • 浏览: 162854 次
  • 性别: Icon_minigender_1
  • 来自: 成都
社区版块
存档分类
最新评论

插入更新与删除

    博客分类:
  • SQL
阅读更多
从一个表向另一个表复制
insert into dept_east(deptno,dname.loc) select deptno ,dname,loc from dept where loc in('NEW YORK','BOSTON')



复制表
问题:要创建表,该表于已有表的列值相同
DB2
create table dept_2 like dept

oracle
在CREATE TABLE命令中,使用一个不返回任何行的子查询
create table dept_2 as select * from dept where 1=0

SQL Server
select * into dept_2 from dept where 1=0



分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics