折雨的天空

新浪微薄腾讯微薄

最新碎语:最近霉到了住。哎。。。

您的位置:折雨的天空 >其他技术> oracle中空值替换,精度空值(保留小数位数),时间转换

oracle中空值替换,精度空值(保留小数位数),时间转换

两个SQL语句,分别为函数nvl,round,substr和to_date


insert into TB_ZY_QTYZMX__ (YLJGDM,YZID,JZLSH,YZZID,CXBZ,YZKSSJ,YZJDHSBH,YZJDHSXM,YZJDSJ,TZYSBH,TZYSXM,YSTZSJ,QRTZHSBH,QRTZHSXM,ZXKSBM,ZXKSMC,ZXRBH,ZXRXM,YZZXSJ,YZZZSJ,YZSM,YZXH,YZZH,YZMXBM,YZMXMC,YZXMFLDM,YZXMFLMC,ZLXMLBBM,ZXPL,CJFX,CJBB,JCBW,MZFS,BZ,MJ,XGBZ,GRBSLX,GRBSH) select replace(YLJGDM,'-','') as YLJGDM,YZID,JZLSH,YZZID,CXBZ,to_date(YZKSSJ,'yyyy-MM-dd hh24:mi:ss'),nvl(YZJDHSBH,'-'),nvl(YZJDHSXM,'-'),to_date(YZJDSJ,'yyyy-MM-dd hh24:mi:ss'),TZYSBH,TZYSXM,to_date(YSTZSJ,'yyyy-MM-dd hh24:mi:ss'),nvl(QRTZHSBH,'-'),nvl(QRTZHSXM,'-'),ZXKSBM,ZXKSMC,nvl(ZXRBH,'-'),nvl(ZXRXM,'-'),to_date(YZZXSJ,'yyyy-MM-dd hh24:mi:ss'),to_date(YZZZSJ,'yyyy-MM-dd hh24:mi:ss'),nvl(YZSM,'-'),YZXH,YZZH,nvl(YZMXBM,'-'),nvl(YZMXMC,'-'),YZXMFLDM,YZXMFLMC,ZLXMLBBM,ZXPL,CJFX,CJBB,JCBW,MZFS,nvl(BZ,'-'),MJ,XGBZ,GRBSLX,GRBSH from TB_ZY_QTYZMX ;

------------------------------------------------------------------------------------------------

insert into TB_MZ_YPCFMXB__ (YLJGDM,CFMXID,JZLSH,GRBSLX,GRBSH,CFZID,CFYZXH,CFYZZH,ZLXMLBBM,XMBM,XMMC,XMFLBM,XMFLMC,JXDM,YPGG,YYTJDM,SYPCDM,YYPC,SYCJL,SYJLDW,SYZJL,ZYYYFF,FYSL,FYSLDW,YYTS,YWLX,CFKSSJ,CFTZSJ,ZXKSBM,ZXKSMC,ZXRBH,ZXRXM,CFZXSJ,BZ,MJ,XGBZ) select replace(YLJGDM,'-','') as YLJGDM,CFMXID,JZLSH,GRBSLX,GRBSH,CFZID,CFYZXH,CFYZZH,ZLXMLBBM,nvl(XMBM,'-'),nvl(XMMC,'-'),XMFLBM,XMFLMC,JXDM,YPGG,YYTJDM,SYPCDM,YYPC,round(SYCJL,3),SYJLDW,round(SYZJL,3),ZYYYFF,substr(round(FYSL,2),0,5),FYSLDW,round(YYTS,2),YWLX,CFKSSJ,CFTZSJ,ZXKSBM,ZXKSMC,nvl(ZXRBH,'-'),nvl(ZXRXM,'-'),CFZXSJ,nvl(BZ,'-'),MJ,XGBZ from TB_MZ_YPCFMXB ;

------------正 文 已 结 束, 感 谢 您 的 阅 读 (折雨的天空)--------------------

转载请注明本文标题和链接:《oracle中空值替换,精度空值(保留小数位数),时间转换

奖励一下

取消

您的认可,是我写博客的动力,谢谢您!

扫码支持
扫码打赏,你说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

发表评论

路人甲 表情
看不清楚?点图切换