zoukankan      html  css  js  c++  java
  • OCI-22053: 溢出错误

    oracle有一种错误OCI-22053: 溢出错误,一种情况就是小数点后太多位数。用round((1-SUM(OutNoQualifiedNum)/SUM(OutPeccancyNum)),5)函数保留小数点后5位

    例如:

    SELECT SUM(CASE WHEN OutPeccancyNum=0 THEN 1 ELSE 0 END) AS InPersonNum,
    SUM(CASE WHEN InPeccancyNum=0 THEN 1 ELSE 0 END) AS OutPersonNum,
    SUM(InPeccancyNum) AS InPeccancyNum,SUM(InNoQualifiedNum) AS InNoQualifiedNum,
    (CASE WHEN SUM(InPeccancyNum)=0 THEN 0 ELSE round((1-SUM(InNoQualifiedNum)/SUM(InPeccancyNum)),5) END) AS InQualifiedRate,
    SUM(OutPeccancyNum) AS OutPeccancyNum,
    SUM(OutNoQualifiedNum) AS OutNoQualifiedNum,
    (CASE WHEN SUM(OutNoQualifiedNum)=0 THEN 0 ELSE round((1-SUM(OutNoQualifiedNum)/SUM(OutPeccancyNum)),5) END) AS OutQualifiedRate,
    SquadronID
    FROM REP_PersonPeccancyByMonth  Where 1=1  and StatisticsMonth='2015-04'
    GROUP BY SquadronID

  • 相关阅读:
    write to logfile
    open and read a file content to a variable
    strategy
    Android 开机启动程序
    消息队列
    卡机音乐功能实现
    Android 2.0 开机动画文件分析
    多线程实例
    消息队列
    多线程实例
  • 原文地址:https://www.cnblogs.com/myzxjspace/p/4939704.html
Copyright © 2011-2022 走看看