比如数据源的日期字段,是字符型,格式是‘20111101’
建立视图时,能否直接改成‘2011-11-01’格式?
------解决方案--------------------
可以,在你建视图的语句中进行时间格式化就好了.
create view date_view as
select
substr(acct_open_dt,1,4)||'-'||substr(acct_open_dt,5,2)||'-'||substr(acct_open_dt,7,2) as etl_date from tableName
where xxx='000000000101'
------解决方案--------------------
- SQL code
Create view v1asselect to_date(日期字段,'yyyy-mm-dd') as Date1from TableName