当前位置:数据库 > Oracle >>

oracle查出每一天

查出时间段内的每一天
  www.zzzyk.com  
select level,to_char(to_date('2013-01-01','yyyy-mm-dd')+level-1,'yyyy-mm-dd') as dat from dual
connect by level <=to_date('2013-01-18','yyyy-mm-dd')-to_date('2013-01-01','yyyy-mm-dd')+1


 
查出12个月    www.zzzyk.com  
select decode('0'||level,'010','10','011','11','012','12','0'||level||'') as dat from dual connect by level <= 12
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,