select round(2 3);OK_c02 0Time taken: 0 081 seconds, Fet ">
IT培訓(xùn)網(wǎng)
IT在線學(xué)習(xí)
4、ceil(double a), ceiling(double a)
hive (default)> select ceil(2.3);
OK
_c0
3
Time taken: 0.942 seconds, Fetched: 1 row(s)
hive (default)> select ceiling(2.3);
OK
_c0
3
Time taken: 0.096 seconds, Fetched: 1 row(s)
說明:ceil和ceiling函數(shù)的功能是一樣的,對(duì)2.3上取整,結(jié)果為3
hive (default)> select ceil(2.8);
OK
_c0
3
Time taken: 0.07 seconds, Fetched: 1 row(s)
hive (default)> select ceiling(2.8);
OK
_c0
3
說明:對(duì)2.8上取整,結(jié)果為3
5、rand()
hive (default)> select rand();
OK
_c0
0.45944267022402563
Time taken: 0.104 seconds, Fetched: 1 row(s)
hive (default)> select rand();
OK
_c0
0.03447519492300788
說明:返回0-1之間的隨機(jī)數(shù)
6、rand(seed)
hive (default)> select rand(3);
OK
_c0
0.731057369148862
Time taken: 1.436 seconds, Fetched: 1 row(s)
hive (default)> select rand(3);
OK
_c0
0.731057369148862
Time taken: 0.104 seconds, Fetched: 1 row(s)
hive (default)> select rand(5);
OK
_c0
0.730519863614471
Time taken: 0.09 seconds, Fetched: 1 row(s)
說明:種子數(shù)相同,得到的隨機(jī)數(shù)相同。種子數(shù)不同,得到不同的隨機(jī)數(shù)
>>本文地址:http://www.yceu.cn/zhuanye/2020/49269.html
聲明:本站稿件版權(quán)均屬中公教育優(yōu)就業(yè)所有,未經(jīng)許可不得擅自轉(zhuǎn)載。
1 您的年齡
2 您的學(xué)歷
3 您更想做哪個(gè)方向的工作?