MariaDBで小数点以下を切り上げる
環境
windows 10 64 bit
MariaDB 10.6.4
書式
CEIL( 値 )
TRUNCATE( 値 )
使用例1
MariaDB [(none)]> SELECT -> CEIL( 5.7 ) v1, -> CEIL( 6.8 ) v2; +----+----+ | v1 | v2 | +----+----+ | 6 | 7 | +----+----+
使用例2
MariaDB [(none)]> SELECT -> TRUNCATE( -3.7,0 ) v1, -> TRUNCATE( -5.6,0 ) v2; +----+----+ | v1 | v2 | +----+----+ | -3 | -5 | +----+----+