当前位置:网站首页>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)
边栏推荐
- [latex bearer] use tables in \title (error \begin doesn't match its definition.)
- 探讨:下一代稳定币
- Classical synchronization problem
- Screenshot of the answers to C language exercises
- [C language] static modifies local variables
- Science | giant bacteria found in mangroves challenge the traditional concept of nuclear free membrane
- Teach you to learn dapr - 9 Observability
- Convert the decimal positive integer m into the number in the forward K (2 < =k < =9) system and output it in bits
- Day10 daily 3 questions (1): sum gradually to get the minimum value of positive numbers
- Romance of the Three Kingdoms: responsibility chain model
猜你喜欢
Synchronized description of concurrency
R329 (maix-ii-a (M2A) data summary
Summary of all knowledge points of C language
Platform management background and merchant menu resource management: Design of platform management background data service
Deployment and operation of mongodb partitioned cluster
Vue--vuerouter cache routing component
When I was in the library, I thought of the yuan sharing mode
Inspirational. In one year, from Xiaobai to entering the core Department of Alibaba, his counter attack
Discover K8E: minimalist kubernetes distribution
Live broadcast preview | how can programmers improve R & D efficiency? On the evening of June 21, the video number and station B will broadcast live at the same time. See you or leave!
随机推荐
Viewing the task arrangement ability of monorepo tool from turborepo
Daily record 2
Calculate the average of N numbers in the index group of X, and return the number that is less than the average and closest to the average through formal parameters
Introduction to distributed cache / cache cluster
When I was in the library, I thought of the yuan sharing mode
[matlab project practice] prediction of remaining service life of lithium ion battery based on convolutional neural network and bidirectional long short time (cnn-lstm) fusion
Quantitative contract system development analysis case - detailed explanation of contract quantitative system development scheme
分布式架构概述
What does the equals method compare? Who told you
Use FST JSON to automatically generate faster JSON serialization methods
7 views on NFT market prospect
Microservice architecture practice: business management background and SSO design: SSO design
Find all primes less than or equal to Lim, store them in AA array, and return the number of primes
Redis and database data consistency
Teach you to learn dapr - 9 Observability
Web3 decentralized storage ecological landscape
Leetcode topic [array] -268- missing numbers
Problems encountered this week
Romance of the Three Kingdoms: responsibility chain model
num[i]++