时间:2021-07-01 10:21:17 帮助过:4人阅读
--一年有多少个星期 with x0 as (select to_date(‘2018-01-01‘,‘yyyy-mm-dd‘) as 年初 from dual ), x1 as (select 年初,add_months(年初,12) as 下年年初 from x0), x2 as (select 年初,下年年初,下年年初-年初 as 天数 from x1), x3 as (select 年初+level-1 as 日期 from x2 connect by level <=天数 ), x4 as (select 日期,to_char(日期,‘DAY‘) AS 星期 FROM X3) SELECT 星期,count(*) from x4 group by 星期
(012)每日SQL学习:TO_CHAR(DATE,FORMAT)
标签:width add table weight details sel har ble cell