#第9章SQL语言
#【例9.1】 使用RAND()函数求3个随机值。
select rand() as 随机值1,rand() as 随机值2 ,rand()as 随机值3;
select rand()*100 as 随机值100;
select rand()*(100-0)+0;
select rand()*(1000-100)+100;
select rand()*(b-a)+a;
#【例9.2】 求3和4的平方根。
select sqrt(3),sqrt(4);
#【例9.3】 求7.2和-7.2的绝对值。
#【例9.4】 求小于或等于-3.5或6.8的最大整数,大于或等于-3.5或6.8的最小整数。
select floor(-3.4),floor(6.8);
select ceil(-3.5),ceiling(6.8);
#【例9.5】 求8.546小数点后2位的值和四舍五入的整数值。
select truncate(8.546,2);
select round(8.546);
select round(8.546,2);