当前位置:网站首页>Calculate division in Oracle - solve the error report when the divisor is zero
Calculate division in Oracle - solve the error report when the divisor is zero
2022-06-26 07:09:00 【Milk coffee 13】
One 、 Problem description
stay Oracle In the database , You need to use division , But the divisor may be zero , If used directly sql Division operator in (/), May be an error .
Two 、 Problem analysis
Through analysis, we found that , Yes, the divisor is 0 There will be problems , Then we can exclude the divisor of zero and directly specify the result as 0, And then we're doing division ( In addition, the division will result in a long number of decimal places , Need to cooperate with Round Function to intercept the corresponding reserved decimal places ).
3、 ... and 、 terms of settlement
3.1、 Syntax and examples for calculating division
--Oracle Calculation division syntax in
SELECT case WHEN(NVL( Divisor , 0))!=0 THEN round( Divisor / Divisor , Number of decimal places to be reserved ) ELSE 0 END result FROM DUAL
3.2、 Calculate the contents of the function used for division
Oracle in Case When Usage of https://coffeemilk.blog.csdn.net/article/details/121215294
边栏推荐
- 安装homebrew报错汇总
- Operation mode and investment planning report of China's financial warehousing industry during the "14th five year plan" period 2022-2027
- Here comes the apple ar/vr device exclusive system! Or named realityos
- Alkynyl crosslinked porphyrin based polyimide materials (ppbpi-h-cr, ppbpi Mn cr.ppbpi Fe Cr); Metalloporphyrin based polyimide (ppbpi Mn, ppbpi FE) supplied by Qiyue
- Analysis report on market demand and investment competitiveness of China's cyclohexanone industry (2022 Edition)
- Development trends and prospects of acrylamide crystallization market in the world and China 2022-2027
- The performance of iron and steel enterprises was expected to be good in January this year. Since February, the prices of products of iron and steel enterprises have increased significantly. A mighty
- The difference between insert ignore and insert into
- MySQL (III)
- Parameter index out of range (0 < 1) (1> number of parameters, which is 0
猜你喜欢
STM32F1与STM32CubeIDE编程实例-热敏传感器驱动
. Net 20th anniversary! Microsoft sends a document to celebrate
5,10,15,20-tetra (4-bromophenyl) porphyrin (h2tppbr4) /5.2.15,10,15,20-tetra [4-[(3-aminophenyl) ethynyl] phenyl] porphyrin (tapepp) Qiyue porphyrin reagent
【图像分割】基于最大主曲率实现视网膜眼底图像中的血管提取附matlab代码
Porphyrin based polyimide (ppbpis); Synthesis of crosslinked porphyrin based polyimides (ppbpi CRS) porphyrin products supplied by Qiyue biology
Oracle中计算除法——解决除数为零报错
Easyar use of unity
Professional course - Code question record
【图像检测】基于Itti模型实现图像显著性检测附matlab代码
Invalid problem of self defined map used by Gaode map
随机推荐
[image detection] image saliency detection based on ITTI model with matlab code
es 中 mapping 简介
The difference between insert ignore and insert into
Item2 installation configuration and environment failure solution
Easyar use of unity
MySQL
php array_ Merge details
MySQL operation database
Numpy learning challenge level 5 - create array
C#实现给DevExpress中GridView表格指定列添加进度条显示效果——代码实现方式
SQL Basics
China's wind farm operation industry's "fourteenth five year plan" planning direction and investment risk prediction report 2022-2027
Turris omnia: an open source router technology favored by hackers
一文深入底层分析Redis对象结构
[004] [stm32] MDK project configuration and commissioning
Big factory interview TCP protocol classic 15 consecutive questions! 22 pictures to make you fully understand
PXRD, IR, TGA of two-dimensional porphyrin COF (POR COF) /cof (2D pdpor COF) - supplied by Qiyue
Es string type (text vs keyword) selection
SQL query statement
ZRaQnHYDAe