Home > Database > Mysql Tutorial > 求一段連續日期,但排除六日

求一段連續日期,但排除六日

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 14:57:26
Original
1279 people have browsed it

求一段連續日期,但排除六日 自已標記一下,方便以後查尋 无 select allday from (select to_date('2007-02-15','yyyy-mm-dd')+rownum allday from(select to_date('2007-02-15','yyyy-mm-dd'),to_date('2007-02-28','yyyy-mm-dd') from dual)connect by rown

求一段連續日期,但排除六日 
自已標記一下,方便以後查尋

1

2

3

4

5

select allday from (

select to_date('2007-02-15','yyyy-mm-dd')+rownum allday from

(select to_date('2007-02-15','yyyy-mm-dd'),to_date('2007-02-28','yyyy-mm-dd') from dual)

connect by rownum < to_date('2007-02-28','yyyy-mm-dd')-to_date('2007-02-15','yyyy-mm-dd')

) where to_char(allday,'D') >1 and to_char(allday,'D') <7

Copy after login
Related labels:
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
Latest Issues
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template