Create table dim_todate as
SELECT mid_date as date_key --日-月-年
,day as date_value --日月年
,year(day) as year_num --年
,case when month(day) < 7 then 'Q1' else 'Q2' end as half_year --半年
,lpad(ceil(month(day)/3),2,0) as season --季度
,floor(mid_date/10000)*100 + lpad(ceil(month(day)/3),2,0) as year_season --年-季度
,month(day) as month_num --月
hive 时间维度表
最新推荐文章于 2023-07-05 09:06:36 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)