我已經演示表 我想創建視圖,這是我的查詢查詢到24日期格式12日期格式轉換成蜂巢
create view Demo_View as
select sms_sent_identifier,year(sms_sent_dt) Year1,
case month(sms_sent_dt)
when 1 then 'Q1'
when 2 then 'Q1'
when 3 then 'Q1'
when 4 then 'Q2'
when 5 then 'Q2'
when 6 then 'Q2'
when 7 then 'Q3'
when 8 then 'Q3'
when 9 then 'Q3'
when 10 then 'Q4'
when 11 then 'Q4'
when 12 then 'Q4'
end Quarter1,
Month(sms_sent_dt) Month1,
day(sms_sent_dt) Date1,
***hour(sms_sent_dt) Hour1,***
minute(sms_sent_dt) Minute1
from subs_sms;
O/P它給日時爲如12,13我想要12格式,即上午11點,上午12點 我應該怎麼做
採取看看下面的鏈接:http://docs.oracle.com/javase/tutorial/i18n /format/simpleDateFormat.html&https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF#LanguageManualUDF-DateFunctions – Ambrish