mysql round()函数以及convert()函数,保留n位小数
mysql> select round(2.232,2); +----------------+ | round(2.232,2) | +----------------+ | 2.23 | +----------------+ 1 row in set (0.00 sec) mysql> select convert(1.2323,decimal(6,2)); +------------------------------+ | convert(1.2323,decimal(6,2)) | +------------------------------+ | 1.23 | +------------------------------+ 1 row in set (0.00 sec)