Home > Database > Mysql Tutorial > 用SQL取到本月为止的今年所有月份

用SQL取到本月为止的今年所有月份

WBOY
Release: 2016-06-07 14:54:42
Original
1992 people have browsed it

PL/SQL 有的时候,展现数据要展现到本月为止,或者到选择月份为止的本年所有月份的值。 SQL 月份 select lpad(rownum - 0, 2, 0) ymd from dualconnect by rownum = substr('20101130', 5, 2)

PL/SQL
有的时候,展现数据要展现到本月为止,或者到选择月份为止的本年所有月份的值。

SQL 月份
select lpad(rownum - 0, 2, 0) ymd
  from dual
connect by rownum <= substr('20101130', 5, 2)
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