运算符 含义

 

· +(加)   加法
· ||(加) 字符串相加
· -(减)   减法
· *(乘)   乘法
· /(除)   除法
· mod(模)返回一个除法的整数余数

 

 例如,12 % 5 = 2,这是因为 12 除以 5,余数为 2

 


示例:
select5+6,5+nullfrom dual
select5-6from dual
select5*6from dual
select5/6from dual
selectmod(13,3)from dual

 

 
列的计算:

 

select 字段A+字段B form 表
select 字段A*2 form 表
 
power(2,3):求2的3次方
round(值,小数位):4合5入
Floor:小数部分直接舍弃,整数不变
CEIL:小数部分直接舍弃,整数+1

--2*2*2*2
select power(2,4)from dual

--问题(了解):求8开根3后的值
--a*a*a=8,a=?
select power(8,1/3)from dual

--四舍五入:
--小数位为0,表示四舍五入以后,返回整数
select round(0.49)from dual
select round(0.5)from dual

--保留2位小数
select round(0.33333,2)from dual

--Floor:小数部分直接舍弃,整数不变
select floor(10.9)from dual
--CEIL:小数部分直接舍弃,整数+1
select Ceil(10.1)from dual

相关文章:

  • 2021-11-23
  • 2022-01-03
  • 2021-05-23
  • 2021-12-25
  • 2021-12-04
  • 2021-12-05
  • 2020-03-29
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-05-27
  • 2020-04-23
  • 2021-12-25
  • 2022-12-23
  • 2021-06-19
  • 2022-12-23
相关资源
相似解决方案