round函数 mysql
时间: 2023-10-17 12:25:34 浏览: 96
在MySQL中,ROUND函数用于对查询结果进行四舍五入。它可以接受一个参数或两个参数。当只有一个参数时,ROUND函数将对该参数进行四舍五入并返回整数部分。例如,ROUND(-6.6)将返回-7,ROUND(1.58)将返回2。当有两个参数时,第一个参数是要进行四舍五入的值,第二个参数是要保留的小数位数。例如,ROUND(1123.26723, 2)将返回1123.27。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [MySQL之ROUND函数四舍五入的陷阱](https://download.csdn.net/download/weixin_38724535/14833437)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [[Mysql] ROUND函数](https://blog.csdn.net/Hudas/article/details/123699554)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文