首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > 其他数据库 >

当前日期的周日日期怎么取得

2013-03-01 
当前日期的周日日期如何取得update DIM_TIME fset f.firstday_of_week casewhen f.full_date round(f.

当前日期的周日日期如何取得

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;

热点排行