ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 修改表的字段类型

修改表的字段类型

原创 Linux操作系统 作者:why566 时间:2008-07-10 13:49:43 0 删除 编辑
第一种方法: (1).create table new_table as select  to_number(clip_stime) clip_stime,clip_path from vf_clipinfo;这里我们要改字段clip_stime的类型为number (2).重建相关的索引和约束等. 第二种方法: (1).exp现有表 (2).truncate table  (3).alter table table_name  modify column  new_type; (4).imp DMP文件. 第三种方法: (1).增加新列 alter table table_name add new_col; (2).更新新列 update tablename set new_col=old_col; (3).删除旧列alter table table_name  drop column old_col; (4).修改新列名为原来表的列名 alter table tablename rename column new_col  to old_col;

 

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/7478833/viewspace-374927/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: oracle外连接
请登录后发表评论 登录
全部评论

注册时间:2008-07-04

  • 博文量
    46
  • 访问量
    95677