当前位置:操作系统 > Unix/Linux >>

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

当前日期的周日日期如何取得
 
Java代码    www.zzzyk.com  
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  
 
检查一下更新的是否正确   www.zzzyk.com  
Java代码  
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;  
 
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,