a我考网

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 65|回复: 0

[综合] 如何快速接触Oracle数据库的日历

[复制链接]
发表于 2012-8-4 13:54:49 | 显示全部楼层 |阅读模式
select case when (new_yweek = min(new_yweek)over(partition by mon order by new_yweek)) then mon_name else null end as month, new_yweek as yweek, row_number() over(partition by mon order by new_yweek) as mweek, sum(decode(wday, ‘1‘, mday, null)) as sun, sum(decode(wday, ‘2‘, mday, null)) as mon, sum(decode(wday, ‘3‘, mday, null)) as tue, sum(decode(wday, ‘4‘, mday, null)) as wed, sum(decode(wday, ‘5‘, mday, null)) as thu, sum(decode(wday, ‘6‘, mday, null)) as fri, sum(decode(wday, ‘7‘, mday, null)) as sat from (select dayofyear as everyday, to_char(dayofyear, ‘mm‘) as mon, to_char(dayofyear, ‘Month‘) as mon_name, to_char(dayofyear, ‘w‘) as mweek, to_char(dayofyear, ‘ww‘) as yweek, case when (to_char(to_date(&year
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Woexam.Com ( 湘ICP备18023104号 )

GMT+8, 2024-5-14 12:29 , Processed in 0.976430 second(s), 21 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表