选择备用行作为单独的列

时间:2013-10-30 13:33:15

标签: sql-server-2005 rows

我有一张这样的表:

  Date          Day
-------------------------
  2010-01-02    Saturday
  2010-01-03    Sunday
  2010-01-09    Saturday
  2010-01-10    Sunday
  ........      ......
  ........      ........

我想将其显示如下:

    FromDate    FromDay    ToDate       ToDay
---------------------------------------------------------
  2010-01-02    Saturday   2010-01-03    Sunday
  2010-01-09    Saturday   2010-01-10    Sunday 
  ........      ........   ...........   ......
  ........      ........   ...........   ......

我刚从http://blog.sqlauthority.com/2009/12/29/sql-server-get-date-of-all-weekdays-or-weekends-of-the-year/

复制了查询
 But I don't know how to split as required. 

0 个答案:

没有答案