Home  >  Article  >  Database  >  SQL中取得传入月份值的所有天数

SQL中取得传入月份值的所有天数

WBOY
WBOYOriginal
2016-06-07 14:54:471494browse

SQL中取得传入月份值的所有天数 使用Oracle PL/SQL 无 select lpad(rownum, 2, 0) ymd from dualconnect by rownum = (SELECT add_months(trunc(to_date('201002', 'yyyymm'), 'mm'), 1) - trunc(to_date('201002', 'yyyymm'), 'mm') FROM DUAL)

SQL中取得传入月份值的所有天数
使用Oracle
PL/SQL
select lpad(rownum, 2, 0) ymd
  from dual
connect by rownum <=
           (SELECT add_months(trunc(to_date('201002', 'yyyymm'), 'mm'), 1) -
                   trunc(to_date('201002', 'yyyymm'), 'mm')
              FROM DUAL)
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn