zoukankan      html  css  js  c++  java
  • 批量替换字符和字段类型

    替换字符

       update alm_debt_asset set org_term_mult= 
       (case  when org_term_mult='' then 113606 
        when org_term_mult='' then 113603   
          when org_term_mult='' then 113604  
        else 0
       end)
       ,AMRT_TYPE_CD= 
        (case  when AMRT_TYPE_CD='部分分期等额偿还' then 108402
        when AMRT_TYPE_CD='完全分期等额偿还' then 108401 
        else 0
       end)
       ,PMT_FREQ_MULT=
        (case  when PMT_FREQ_MULT='Monthly' then 114402
        when PMT_FREQ_MULT='Annual' then 114405 
        else 0
        end)
       ,ACCRUAL_BASIS_CD=
        (case  when ACCRUAL_BASIS_CD='前期计入' then 100502
        when ACCRUAL_BASIS_CD='当期计入' then 100501
        else 0
        end)
         ,REPRICE_FREQ_MULT=
        (case  when REPRICE_FREQ_MULT='Monthly' then 114401
        when REPRICE_FREQ_MULT='BIMONTHLY' then 114404
        else 0
        end)
        ,INT_TYPE=
        (case  when INT_TYPE='期前' then 107601
        when INT_TYPE='期末' then 107602
        else 0
        end)
        ,ADJUSTABLE_TYPE_CD=
        (case  when ADJUSTABLE_TYPE_CD='每满一年' then 108502
        when ADJUSTABLE_TYPE_CD='双方约定' then 108503
        else 0
        end)

    替换字段类型

    create table new as select * from alm_debt_asset where 1=2;
    alter table new modify (org_term_mult number(11),AMRT_TYPE_CD number(11),PMT_FREQ_MULT number(11),ACCRUAL_BASIS_CD number(11),REPRICE_FREQ_MULT number(11),INT_TYPE number(11),ADJUSTABLE_TYPE_CD number(11));
    insert into new select * from alm_debt_asset;
    drop table alm_debt_asset;
  • 相关阅读:
    Centos安装Memcached和(Nginx)Memcache扩展详细教程
    文章已被删除!
    phonegap安卓手机开发入门
    微信分享链接带图片文字和描述
    CSDN数据库被爆 统计CSDN用户都喜欢哪些密码
    ...
    重新初始化 VS2010
    spark系列之基本概念
    python 数字字典加密非汉字
    MySQL 5.7实现 row_number窗口函数
  • 原文地址:https://www.cnblogs.com/lilb/p/5016604.html
Copyright © 2011-2022 走看看