집 >데이터 베이스 >MySQL 튜토리얼 >mysql TRUNCATE()函数使用实例
TRUNCATE(x,y)返回数值x保留到小数点后y位的值(与ROUND最大的区别是不会进行四舍五入),请看下面实例:
<code class="language-sql">mysql>SELECT TRUNCATE(7.536432,2); +---------------------------------------------------------+ | TRUNCATE(7.536432,2) | +---------------------------------------------------------+ | 7.53 | +---------------------------------------------------------+ 1 row in set (0.00 sec)</code>