当前位置: 首页 > news >正文

大连微网站建设搜狗站长平台验证网站

大连微网站建设,搜狗站长平台验证网站,手机网站策划书方案,做哪种类型网站赚钱背景 整型除以整型#xff0c;正常情况下当然得到的应该也是整型。数据库也是这么干的。 但是在数据库应用中#xff0c;通常业务的需求是得到NUMERIC#xff0c;不能直接把小数干掉。 数据库的行为给用户带来了诸多不便#xff0c;例如1除以2#xff0c;如果是整型除法会… 背景 整型除以整型正常情况下当然得到的应该也是整型。数据库也是这么干的。 但是在数据库应用中通常业务的需求是得到NUMERIC不能直接把小数干掉。 数据库的行为给用户带来了诸多不便例如1除以2如果是整型除法会得到0然而用户可能要的是0.5。 那么怎么处理呢 1、建议用户使用float8, money, numeric来存储这种数值。 2、或者在除法时对操作数进行转换。 操作符 postgres# \do / List of operators Schema | Name | Left arg type | Right arg type | Result type | Function | Description --------------------------------------------------------------------------------------------------------------------- pg_catalog | / | bigint | bigint | bigint | int8div | divide pg_catalog | / | bigint | integer | bigint | int84div | divide pg_catalog | / | bigint | smallint | bigint | int82div | divide pg_catalog | / | box | point | box | box_div | divide box by point (scale) pg_catalog | / | circle | point | circle | circle_div_pt | divide pg_catalog | / | double precision | double precision | double precision | float8div | divide pg_catalog | / | double precision | real | double precision | float84div | divide pg_catalog | / | integer | bigint | bigint | int48div | divide pg_catalog | / | integer | integer | integer | int4div | divide pg_catalog | / | integer | smallint | integer | int42div | divide pg_catalog | / | interval | double precision | interval | interval_div | divide pg_catalog | / | money | bigint | money | cash_div_int8 | divide pg_catalog | / | money | double precision | money | cash_div_flt8 | divide pg_catalog | / | money | integer | money | cash_div_int4 | divide pg_catalog | / | money | money | double precision | cash_div_cash | divide pg_catalog | / | money | real | money | cash_div_flt4 | divide pg_catalog | / | money | smallint | money | cash_div_int2 | divide pg_catalog | / | numeric | numeric | numeric | numeric_div | divide pg_catalog | / | path | point | path | path_div_pt | divide (rotate/scale path) pg_catalog | / | point | point | point | point_div | divide points (scale/rotate) pg_catalog | / | real | double precision | double precision | float48div | divide pg_catalog | / | real | real | real | float4div | divide pg_catalog | / | smallint | bigint | bigint | int28div | divide pg_catalog | / | smallint | integer | integer | int24div | divide pg_catalog | / | smallint | smallint | smallint | int2div | divide (25 rows) 显示转换 int 转成 numeric或者float8后再除。 例子 postgres# select 1/2; ?column? ---------- 0 (1 row) 显示转换任意操作数postgres# select 1/2.0; ?column? ---------- 0.5 (1 row) postgres# select 1/2::float8; ?column? ---------- 0.5 (1 row) postgres# select 1/2::numeric; ?column? ------------------------ 0.50000000000000000000 (1 row) 本篇文章如有帮助到您请给「翎野君」点个赞感谢您的支持。 首发链接 https://www.cnblogs.com/lingyejun/p/17678380.html
http://www.hkea.cn/news/14562168/

相关文章:

  • 做宣传网站大概多少钱网站建设业务客户来源
  • 论坛网站模板源码下载重庆网站优化seo公司
  • )网站开发架构师4G访问wordpress
  • 福田做网站多少钱网络规划设计师教程第二版 pdf下载地址
  • 万网续费登录网站高端装修公司怎么获客
  • dw网站建设教程系统商店
  • 银川住房和城乡建设局网站福永网站建设公司
  • 已被网站管理员设置拦截网络营销推广的方案
  • 福清网站商城建设合肥网站开发招聘
  • 大理州住房和城乡建设局网站深圳品牌女装前十名
  • seo网站的优化流程佛山市官网网站建设多少钱
  • 商城网站源码dede做教程网站资源放哪里
  • 天河门户网站建设廊坊网站建设制作电话
  • 商超网站网站续费管理系统
  • 网站开发简答题家居装修设计
  • 在一个空间建两个网站注册城乡规划师难度
  • 企业做网站公司怎么做三维制图培训班在哪里
  • 徐州网站建设市场分析wordpress采集1024
  • 加强网站集约化建设怎么推广游戏叫别人玩
  • 投诉举报网站 建设方案把wordpress动静分离
  • 网站开发说明wordpress文章自动更新
  • 自己做网站 最好的软件下载河南网站建设的公司
  • 我被钓鱼网站骗了骗取建设信用卡建设银行会怎么处理钱会还回吗wordpress微博同步
  • 国外做珠宝的网站有哪些公司的 SEO与网站建设
  • 地产网站建设方案wordpress调用多媒体
  • 镇平建设局网站企业网站如何上存
  • 廊坊设计网站公司网站建设去哪里找客户
  • 网站开发的源代码怎么算侵权黄页推广2021
  • 国内炫酷的网站设计请人做个网站多少钱
  • 国外做鞋子的网站吗天津个人做网站