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

做网站感想如何修改asp网站栏目

做网站感想,如何修改asp网站栏目,自己做网站的公司,搜索引擎的优化和推广背景 整型除以整型,正常情况下当然得到的应该也是整型。数据库也是这么干的。 但是在数据库应用中,通常业务的需求是得到NUMERIC,不能直接把小数干掉。 数据库的行为给用户带来了诸多不便,例如1除以2,如果是整型除法会…

背景

整型除以整型,正常情况下当然得到的应该也是整型。数据库也是这么干的。

但是在数据库应用中,通常业务的需求是得到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.yayakq.cn/news/304308/

相关文章:

  • 包头教育云网站建设免费网站创建工具
  • 旅游网站建设代码深圳市营销策划有限公司
  • 高质量的合肥网站建设长腿蜘蛛wordpress
  • asp开发网站详细步骤网站图标代码
  • 网站代码组件百度上推广一个网站该怎么做
  • 江苏省网站备案查询wordpress更改鼠标
  • 3g电影网站排行榜数码产品网站建设计划书
  • seo整站优化网站建设什么网站做ppt赚钱
  • 网站广告是内容营销吗wordpress skydrive
  • 城乡和住房建设厅网站网站建设策划范文
  • 网站域名被注销重新备案怎么做简述企业网络建设的流程
  • 购买qq空间访客的网站建设食品网站如何定位
  • 公司网站建设需要什么科目开通网站的请示
  • 建设网站南沙wordpress怎么显示文章时间
  • 网站数据分析表格重庆网站运营公司
  • 大理建设局网站关键词调整排名软件
  • 环保局 网站建设wordpress设置会员有效期
  • 一个免费的网站电影网站建站
  • 电商网站 开发周期公众号平台编辑
  • 徐州市建设局交易网站网站建设的岗位叫什么
  • 手机网站建设行业分析天津众业建设工程有限公司网站
  • 厦门网站建设缑阳建网站宣传需要多少钱
  • wordpress多本小说站出售营销网建
  • 电商系统网站建设天津seo外包平台
  • 做网站都是怎么收费设计学网站
  • 查询友情链接seo优化课程
  • 成品免费观看网站请专业做网站的老师
  • 网站建设二公司网络公司是做什么的
  • 做网站那里好wordpress怎么设置SSL图标
  • 青海专业网站建设推广平台建设建立外贸网站