首页 > 解决方案 > 如何在sql中将多个数字列四舍五入为2位?

问题描述

假设我现在需要将多个数字四舍五入为 2 位数字,但我不想重复使用round(..., 2)or format(...)

有什么方法可以全局设置 2 位浮点数吗?

标签: sqlroundingdigits

解决方案


select cast(float_column as decimal(10,2))
from your_table

推荐阅读