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

用腾讯云做淘宝客网站视频成都抖音seo

用腾讯云做淘宝客网站视频,成都抖音seo,自动推广软件,模板网站配置文件背景 整型除以整型,正常情况下当然得到的应该也是整型。数据库也是这么干的。 但是在数据库应用中,通常业务的需求是得到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.hotlads.com/news/845.html

相关文章:

  • 揭阳建设局网站哪里能买精准客户电话
  • 扶风网站建设全球网站流量排名查询
  • 公司网站建设泉州seo文章推广
  • 做mod游戏下载网站百度知道网页版
  • 宠物网站建设的可行性专业地推团队电话
  • 招聘网站做沙龙成人短期技能培训学校
  • 有没有做网站的联系方式广州专业网络推广公司
  • 网站可以做匿名聊天吗怎么推广app
  • 做网站推广排名网站快速有排名
  • 上海建筑建材业门户网站广告投放平台系统
  • 界面设计风格互联网seo是什么
  • 360免费wifi驱动seo关键词排名优化怎么收费
  • 邮件网站怎么做互联网营销师在哪里报名
  • 秦皇岛网站建设哪家好网站链接分析工具
  • 青岛seo做的好的网站有了域名如何建立网站
  • wordpress二次开发主题seo综合查询怎么关闭
  • 淮安市哪里有做网站如何做好企业网站的推广
  • 深圳网站制作的公司嘉兴西安seo优化顾问
  • 千图网网站怎么做十大网络营销经典案例
  • 学习网页设计网站seo上排名
  • 成都网站制作汕头百度竞价开户渠道
  • 四川交投建设招标网站个人免费自助建站网站
  • 网站建设对网络营销有哪些影响百度推广售后电话
  • wordpress 添加图片不显示seo是什么的简称
  • 网站视频怎么下载到本地成都黑帽seo
  • 建设拼多多一样网站需要多少钱怎么制作属于自己的网址
  • nodejs做后端的网站如何做好宣传推广
  • 提交网站到百度亚马逊市场营销案例分析
  • 通用集团网站模板深圳创新创业大赛
  • 九江市房管局建设官方网站中国十大企业管理培训机构