搜索 社区服务 统计排行 帮助
  • 7866阅读
  • 46回复

虎子04……也是乱喷的一话。另外这种事情、大家都做过吧

楼层直达
级别: 骑士
注册时间:
2006-10-14
在线时间:
10小时
发帖:
948
只看该作者 45楼 发表于: 2008-10-24
引用
最初由 暗黑破坏神 发布


虎子——古代的夜壶

大大满足了我的好奇心

正體說,玫瑰即使改變了名字,她的芳香仍然不便
WITH T AS (SELECT (TO_DATE('20080101', 'YYYYMMDD') - 1 + LEVEL) AS DAY FROM DUAL CONNECT BY LEVEL <= (DATE'2108-12-31'-DATE'2008-01-01'))
SELECT year,DECODE(MOFY,TO_CHAR(DAY+(1-DOFW),'MM'),DECODE(SIGN((1-DOFW)),-1,NULL,TO_CHAR(DAY+(1-DOFW),'YYYYMMDD')),NULL) "1",DECODE(MOFY,TO_CHAR(DAY+(2-DOFW),'MM'),DECODE(SIGN((2-DOFW)),-1,NULL,TO_CHAR(DAY+(2-DOFW),'YYYYMMDD')),NULL) "2",DECODE(MOFY,TO_CHAR(DAY+(3-DOFW),'MM'),DECODE(SIGN((3-DOFW)),-1,NULL,TO_CHAR(DAY+(3-DOFW),'YYYYMMDD')),NULL) "3",DECODE(MOFY,TO_CHAR(DAY+(4-DOFW),'MM'),DECODE(SIGN((4-DOFW)),-1,NULL,TO_CHAR(DAY+(4-DOFW),'YYYYMMDD')),NULL) "4",DECODE(MOFY,TO_CHAR(DAY+(5-DOFW),'MM'),DECODE(SIGN((5-DOFW)),-1,NULL,TO_CHAR(DAY+(5-DOFW),'YYYYMMDD')),NULL) "5",DECODE(MOFY,TO_CHAR(DAY+(6-DOFW),'MM'),DECODE(SIGN((6-DOFW)),-1,NULL,TO_CHAR(DAY+(6-DOFW),'YYYYMMDD')),NULL) "6",DECODE(MOFY,TO_CHAR(DAY+(7-DOFW),'MM'),DECODE(SIGN((7-DOFW)),-1,NULL,TO_CHAR(DAY+(7-DOFW),'YYYYMMDD')),NULL) "7"
FROM(SELECT year,DAY,WOFM,WOFY,MOFY,DOFW,RANK() OVER(PARTITION BY year,MOFY,WOFY ORDER BY DOFW) AS SD FROM (SELECT to_char(day,'yyyy') year ,DAY,to_char(day,'W') AS WOFM,TO_CHAR(DAY+1,'IW') AS WOFY,TO_CHAR(DAY,'MM') AS MOFY,TO_CHAR(DAY,'D') AS DOFW FROM T))WHERE SD = 1 ORDER BY year,LPAD(MOFY,2,'0'),WOFm,wofy
级别: 光明使者
注册时间:
2002-05-08
在线时间:
1718小时
发帖:
8051
只看该作者 46楼 发表于: 2008-10-24
所以台版选择的名字还是有点明智的[/TX]
快速回复

限150 字节
上一个 下一个