当前位置:网站首页>sql中ROUND和TRUNCATE的区别(四舍五入还是截取小数点后几位)
sql中ROUND和TRUNCATE的区别(四舍五入还是截取小数点后几位)
2022-06-26 16:55:00 【大数据小王】
1、ROUND可以进行四舍五入,按照对应的位数
2、TRUNCATE直接按照位数截取,不四舍五入
实例:
select truncate(3.1487,3)

select round(3.1487,3)

边栏推荐
- 关于FlowUs这一款国民好笔记
- 108. simple chat room 11: realize client group chat
- Concurrent thread safety
- SQL injection for Web Security (3)
- Sandboxed container: container or virtual machine
- Wechat app mall, review products, upload commodity pictures, and score Commodity Services
- 【万字总结】以终为始,详细分析高考志愿该怎么填
- Detailed contract quantification system development scheme and technical description of quantitative contract system development
- Set up your own website (16)
- Demonstrate to Xiaobai the case of sub database and sub table
猜你喜欢

Microservice architecture practice: business management background and SSO design, SSO client design

Constructors and Destructors

The latest masterpiece of Alibaba, which took 182 days to produce 1015 pages of distributed full stack manual, is so delicious

关于FlowUs这一款国民好笔记

Alibaba's "high concurrency" tutorial "basic + actual combat + source code + interview + Architecture" is a god class

MS | Xie Liwei group found that mixed probiotics and their metabolites could alleviate colitis

Web3 decentralized storage ecological landscape

When I was in the library, I thought of the yuan sharing mode

7 views on NFT market prospect

Fire evacuation and self rescue... This safety production and fire training is full!
随机推荐
vue--vuerouter缓存路由组件
Web3去中心化存储生态图景
[recommendation system learning] recommendation system architecture
Swap two numbers
Programmer's essential toolkit, please collect!
The student record consists of student number and academic performance. The data of n students have been stored in the a structure array to find out the student record with the lowest performance
[qt learning notes]qt inter thread data communication and data sharing
Stm32f103c8t6 realize breathing lamp code
Convert the decimal positive integer m into the number in the forward K (2 < =k < =9) system and output it in bits
Find all primes less than or equal to Lim, store them in AA array, and return the number of primes
Use the array to calculate the average of N numbers, and output the numbers greater than the average
Teach you to learn dapr - 1 The era of net developers
Day10 daily 3 questions (3): String Matching in array
Teach you to learn dapr - 4 Service invocation
Toupper function
对NFT市场前景的7个看法
Kubecon China 2021 Alibaba cloud special session is coming! These first day highlights should not be missed
Today, I met a "migrant worker" who took out 38K from Tencent, which let me see the ceiling of the foundation
Platform management background and merchant menu resource management: merchant registration management design
Leetcode 1169. Query invalid transactions (if the amount of data is small, this problem still needs to be solved by violent enumeration)