![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
SQL
FangStar8Jeff
这个作者很懒,什么都没留下…
展开
-
Hive的日期处理函数
1)date_format函数(根据格式整理日期)hive (gmall)> select date_format('2019-02-10','yyyy-MM');2019-022)date_add函数(加减日期)hive (gmall)> select date_add('2019-02-10',-1);2019-02-09hive (gmall)> s...原创 2020-01-28 10:16:51 · 248 阅读 · 0 评论 -
Hive的collect_set函数
1)创建原数据表hive (gmall)>drop table if exists stud;create table stud (name string, area string, course string, score int);2)向原数据表中插入数据hive (gmall)>insert into table stud values('zhang3',...原创 2020-01-28 10:15:03 · 1389 阅读 · 0 评论 -
having和where的区别
下面以一个例子来具体的讲解:1. where和having都可以使用的场景1)select addtime,name from dw_users where addtime> 15000000002)select addtime,name from dw_users having addtime> 1500000000解释:上面的having可以用的前提是我已经筛选出了...转载 2019-07-24 09:03:09 · 100 阅读 · 0 评论 -
unix_timestamp、from_unixtime时间戳函数的使用
一、unix_timestamp函数用法1、UNIX_TIMESTAMP() :若无参数调用,则返回一个 Unix timestamp ('1970-01-01 00:00:00' GMT 之后的秒数) 作为无符号整数,得到当前时间戳2、UNIX_TIMESTAMP(date):若用date 来调用 UNIX_TIMESTAMP(),它会将参数值以'1970-01-01 00:00:00...转载 2019-08-03 09:05:42 · 766 阅读 · 0 评论