一、格式化函数
- format(x,n); //将数字x格式化,四舍五入保留小数点后n位
- 返回值为字符串。
- 位数不够用0补齐。如果n为0,结果为整数
二、改变数据类型
- cast(x,as type); //将x转换为type数据类型的值
- convert(x,type); //将x转换为type数据类型的值
- type可以是:binary,char,date,datetime,decimal,signed,unsigned
三、计算表达式的处理速度、时间
- benchmark(count,expr); //expr为一条处理表达式,count为执行的次数,用于返回执行次数需要多久时间
- 通常:一条命令的处理时间为0.00sec(0只是代表处理过程很快,并不是没有花费时间)
- 下面我们处理5000000次version()命令,花费时间为0.03sec