![](https://img2018.cnblogs.com/blog/1536927/201905/1536927-20190514153606700-995080348.png)
//第一列除以第二列 取模
hive> select pmod(1,2);
//四舍五入
select round(3.1344);
hive> select pmod(sal,2) from emp;
//创建表 人名 分数
hive> create table sc(name string,scores Array<int>) row format delimited fields terminated by " " collection items terminated by ",";
zhangsan 98,99,69,39
lisi 68,23,87,90
hive> load data local inpath "/sc.txt" into table sc;
//两个时间差
//工作了多久
===============================================================================================================================
hive> select ename,year(current_date)-year(hiredate) from emp;
==================================
秒
select current_timestamp;
hive> select unix_timestamp();
//当前时间 ——+ 5 天
///当前时间 —— -5 天
================================================================