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

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

WBOY
Release: 2016-06-07 14:54:47
Original
1510 people have browsed it

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)
Copy after login
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template