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

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

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

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)
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