当前位置:编程问答 > 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
Oracle
MySQL
Access
SQLServer
DB2
Excel
SQLite
SYBASE
Postgres
如果你遇到什么编程难题:
请访问www.zzzyk.com 试试
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,