码迷,mamicode.com
首页 > 数据库 > 详细

PostgreSQL除法保留小数

时间:2016-09-26 12:31:38      阅读:779      评论:0      收藏:0      [点我收藏+]

标签:

select round(1::numeric/4::numeric,3);
结果为0.25

select round( cast ( 1 as numeric )/ cast( 4 as numeric),2);

PostgreSQL除法保留小数

标签:

原文地址:http://www.cnblogs.com/esther-qing/p/5908378.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!