当前位置:网站首页>MySQL string field to floating point field
MySQL string field to floating point field
2022-06-22 17:03:00 【Seven days at night】
mysql The conversion type uses two functions :CONVERT( Field / The values that need to be converted , type ) CAST( Field / The values that need to be converted AS type )
Because the previous design , Set the amount field type of a table to varchar
Now you need to use this table according to the user , And the type of table data .
When calculating , You need to convert the type .
Just started using CONVERT(jo.`pay_money`, DECIMAL) This way , The output result is an integer .
Afterthought DECIMAL Declaration syntax of DECIMAL(M,D)
·M Is the maximum number of numbers ( precision ). Its scope is 1~65( In the older MySQL In the version , The allowable range is 1~254).
·D Is the number of digits to the right of the decimal point ( scale ). Its scope is 0~30, But not more than M.
The default number of decimal places reserved is 0
Estimate and modify type conversion sql :CONVERT( Field , DECIMAL( Value length , Keep a few decimal places ))
边栏推荐
- 购买指南丨如何购买一台高质量会议平板,这几个方面一定要对比
- Source code analysis of spark cache
- Short video source code development, high-quality short video source code need to do what?
- 接口(优化类型注解)
- 网传学习通1.7亿密码泄露!有什么补救措施?
- What are the characteristics of the interactive whiteboard? Function introduction of electronic whiteboard
- 【心理学】情感心理学-当代思想和传统思想的碰撞(本篇文章将不定期持续更新)
- spark-cache的源码分析
- Processing source code of spark executor execution results
- linux系统维护篇:mysql8.0.13源码下载及安装之“傻瓜式”操作步骤(linux-centos6.8)亲测可用系列
猜你喜欢

写给 Kubernetes 工程师的 mTLS 指南

0基础如何入门软件测试,能转行成功吗?

JSP learning (2) -- JSP script elements and instructions

Linux system maintenance: mysql8.0.13 source code download and installation "fool" operation steps (Linux centos6.8) test available series

Blazor University (31)表单 —— 验证

Gridhome, a must-have static site generator for beginners

以小见大:一个领域建模的简单示例,理解“领域驱动”。

Qt筆記-QMap自定義鍵(key)

VHEDT业务发展框架

新手必会的静态站点生成器——Gridsome
随机推荐
linux系统维护篇:mysql8.0.13源码下载及安装之“傻瓜式”操作步骤(linux-centos6.8)亲测可用系列
[deep anatomy of C language] keywords if & else & bool type
Interview knowledge points
Learning about ABAP program tuning (IV) loop where key
数据库mysql 主从方案
On the closure function of Scala
Spark streaming receiver startup and data receiving
Spark's NaiveBayes Chinese text classification
社会担当 广汽本田“梦想童行”倡导儿童道路交通安全
High availability ResourceManager
Summary of spark common operators
mysql账号增删改、数据导入导出命令举例
Qt筆記-QMap自定義鍵(key)
使用IDM让百度云加速的方法
Linux system maintenance: mysql8.0.13 source code download and installation "fool" operation steps (Linux centos6.8) test available series
Qt Notes - qmap Custom key
Test for API
Spark Streaming-Receiver启动和数据接收
Processing source code of spark executor execution results
How to add a "security lock" to the mobile office of government and enterprises?