-
Recent Posts
Recent Comments
- yangtingkun on 非空字段空值对查询的影响
- Eric Zong on 非空字段空值对查询的影响
- Kamus on Oracle Ace Director
- 设置全局死锁优先级 | yangtingkun on RAC全局死锁检测时间
- ORA-600(krbounotread_noctx)错误 | yangtingkun on ORA-600(krboReadBitmap_badbitmap)错误
Archives
- December 2020
- February 2019
- December 2018
- November 2018
- October 2018
- July 2018
- June 2018
- May 2018
- July 2016
- July 2013
- June 2013
- November 2012
- October 2012
- September 2012
- August 2012
- July 2012
- June 2012
- May 2012
- April 2012
- March 2012
- February 2012
- January 2012
- December 2011
- November 2011
- October 2011
- September 2011
- August 2011
Categories
Meta
Tag Archives: FOUR
ITPUB SQL大赛第四期
SQL大赛第四期解法的最终答案。 第四期题目参考:http://www.itpub.net/thread-1411495-1-1.html版主newkid点评参考:http://www.itpub.net/thread-1417576-1-1.html 最近整理BLOG文章时发现,这篇文章当时没有贴出来。由于当时发现最后一题出现了错误,且手头的事情比较多,本打算搞清楚之后再把结果贴出来,没想到后来忘记了。虽然已经过去了一年了,不过信守自己的承诺,还是把最终结果贴出来。 我的代码为: WITH DAY AS ( SELECT TO_DATE(:P_START_DATE, ‘YYYYMMDD’) + ROWNUM – 1 DAY FROM DUAL CONNECT BY ROWNUM <= TO_DATE(:P_END_DATE, ‘YYYYMMDD’) – TO_DATE(:P_START_DATE, ‘YYYYMMDD’) + 1 ), COMPANY_INFO AS ( SELECT A.USER_ID, SERVICE_ID, B.COMPANY_ID, GREATEST(START_DATE, TO_DATE(:P_START_DATE, ‘YYYYMMDD’)) … Continue reading