标签:blog http ble nbsp create val select 记录 name
1.case的用法
)格式1
case col
when value then ‘‘
when value then ‘‘
else
‘‘
end
)格式2
case
when col=‘value‘ then ‘‘
when col=‘value‘ then ‘‘
else
‘‘
end
)举例
2.cast
作用:转换
)格式
cast(col as type)
)举例
create table catstest as select empno,ename,cast(sal as string) salary from emp;
3.unix_timestamp
作用:记录时间格式
统计从1970年开始到现在的秒数
hive中的常用方法(case,cast,unix_timestamp)
标签:blog http ble nbsp create val select 记录 name
原文地址:http://www.cnblogs.com/juncaoit/p/6078748.html