SQL中的取整函数FLOOR、ROUND、CEIL、TRUNC、SIGN
1 trunc(value,precision)按精度(precision)截取某个数字,不进行舍入操作。
2 round(value,precision)根据给定的精度(precision)输入数值。
3 ceil (value) 产生大于或等于指定值(value)的最小整数。
4 floor(value)与 ceil()相反,产生小于或等于指定值(value)的最小整数。
5 sign(value) 与绝对值函数ABS()相反。ABS()给出的是值的量而不是其符号,sign(value)则给出值的符号而不是量。
1,返回大于或等于x的最大整数:
SQL> select ceil(23.33) from dual;
CEIL(23.33)
-----------
24
2,返回等于或小于x的最大整数:
SQL> select floor(23.33) from dual;
FLOOR(23.33)
------------
23
3,返回舍入到小数点右边y位的x值:rcund(x,[y])
SQL> select round(23.33) from dual;
ROUND(23.33)
------------
23
4,返回截尾到y位小数的x值:trunc(x,[y])
SQL> select trunc(23.33) from dual;
TRUNC(23.33)
------------
23
5,返回x的符号
SQL> select sign(-23.33) from dual;
SIGN(-23.33)
------------
-1
SQL中的取整函数FLOOR、ROUND、CEIL、TRUNC、SIGN的更多相关文章
- 【转】SQL中的取整函数FLOOR、ROUND、CEIL、TRUNC、SIGN
--------------------------------------------------------------------------1 trunc(value,precision)按精 ...
- Oracle的取整和四舍五入函数——floor,round,ceil,trunc使用说明
Oracle的取整和四舍五入函数——floor,round,ceil,trunc使用说明 FLOOR——对给定的数字取整数位SQL> select floor(2345.67) from dua ...
- 问题:oracle floor;结果:Oracle的取整和四舍五入函数——floor,round,ceil,trunc使用说明
Oracle的取整和四舍五入函数——floor,round,ceil,trunc使用说明 (2011-04-06 16:10:35) 转载▼ 标签: 谈 分类: 渐行渐远 FLOOR——对给定的数字取 ...
- php取整函数floor(),round(),intval(),ceil()
ceil -- 进一法取整说明float ceil ( float value )返回不小于 value 的下一个整数,value 如果有小数部分则进一位.ceil() 返回的类型仍然是 float, ...
- C/C++四种取整函数floor,ceil,trunc,round
处理浮点数操作常用到取整函数,C/C++提供了四种取整函数 floor函数 floor函数:向下取整函数,或称为向负无穷取整 double floor(double x); floor(-5.5) = ...
- Matlab中的取整-floor,ceil,fix,round
FLOOR Round towards minus infinity. FLOOR(X) rounds the elements of X to the nearest integers toward ...
- C#中的取整函数
先放百度的 Math.Ceiling();向上取整 Math.Ceiling()向上取整: d = 4.56789 string res = Math.Ceiling(Convert.ToDecima ...
- sql中#与$取值
在mapper.xml中#与$都是用来取值的 <update id="addUrl"> update user_power set url = #{newurl} wh ...
- C#取整函数Math.Round、Math.Ceiling和Math.Floor
1.Math.Round:四舍六入五取偶 引用内容 Math.Round(0.0) //0Math.Round(0.1) //0Math.Round(0.2) //0Math.Round(0.3) / ...
随机推荐
- leetcode 136
136. Single Number Given an array of integers, every element appears twice except for one. Find that ...
- px,pt,em,rem
一直对px,pt,em,rem的认识有误区,现整理一下,供参考.之后还得整理下关于dpi相关的知识. px(pixe,像素l):是一个虚拟长度单位,是计算机系统的数字化图像长度单位,如果px要换算成物 ...
- NAT协议
NAT服务器的设定 NAT的全名:Network Address Translation;即网络地址的转换: iptables指令就能够修改IP封包的表头数据,IP的目标地址,源地址都可以修改. ...
- fastreport 如何 设置 richview 的 行高
richview中的行高改变有点特别.必须在AfterData 事件执行的时候才能修改: 也就是说,如果简单的放一个按钮,去发送消息给richView->RichEdit ,然后调用frxRep ...
- 编译caffe报错:_ZN5boost16exception_detail10bad_alloc_D2Ev
具体报错信息很长的. text._ZN5boost16exception_detail10bad_alloc_D2Ev[_ZN5boost16exception_detail10bad_alloc_D ...
- hive中的桶
hive中有桶的概念,对于每一个表或者分区,可以进一步组织成桶,说白点,就是更细粒度的数据范围.hive采用列值哈希,然后除以桶的个数以求余的方式决定该条记录存放在哪个桶当中.使用桶的好处:1.获得更 ...
- Variant OLE automation
The Variant data type is the data type for all variables. can contain any kind of data except fixed- ...
- 关于c#中的console用法大全
C#之Console Console.Write 表示向控制台直接写入字符串,不进行换行,可继续接着前面的字符写入.Console.WriteLine 表示向控制台写入字符串后换行.Conso ...
- B站运维团队成长的血泪史
胡凯,bilibili运维负责人,曾经就职于金山软件.金山网络.猎豹移动,负责运维相关工作.Bilibili是国内最大的年轻人潮流文化娱乐社区,银河系知名弹幕视频分享UGC平台. 95后二次元新人 ...
- jquery实现页面动态切换的方法--toggleClass(className)
$(function() { $(".A").click(function() { $(this).toggleClass("B"); }); }); 当点击带 ...