日期:2014-05-16 浏览次数:20351 次
update DIM_TIME f set f.firstday_of_week = case when f.full_date < round(f.full_date, 'day') then to_char(round(f.full_date, 'day') - 7, 'yyyy-mm-dd') else to_char(round(f.full_date, 'day'), 'yyyy-mm-dd') end where f.year<2012
select f.firstday_of_week, case when f.full_date < round(f.full_date, 'day') then to_char(round(f.full_date, 'day') - 7, 'yyyy-mm-dd') else to_char(round(f.full_date, 'day'), 'yyyy-mm-dd') end from dim_time f where f.year<2012;