> cycleNO| month | year| start date | close date |state | prv month | next mnt
> 1 4 2012 1/4/2012 30/4/2012 23:59:59 1 3 5
> 1 5 2012 1/5/2012 31/5/2012 23:59:59 0 4 6
> 1 6 2012 1/6/2012 30/6/2012 23:59:59 0 5 7
> 1 7 2012 1/7/2012 31/7/2012 23:59:59 0 6 8
> 2 4 2012 1/4/2012 30/4/2012 23:59:59 1 3 5
> 2 5 2012 1/5/2012 31/5/2012 23:59:59 0 4 6
> 2 6 2012 1/6/2012 30/6/2012 23:59:59 0 5 7
> 2 7 2012 1/7/2012 31/7/2012 23:59:59 0 6 8
上記のようなテーブル(cycle_set)があり、状態= 0の条件で(cycleNO、month、year、start date、close date)をフェッチしたいのですが、start-close dateには、翌月のシステム日付も含まれています。状態=0。
出力は次のようになります:
cycleNO | month | year | start date | close date 1 5 2012 1/5/2012 31/5/2012 23:59:59 1 6 2012 1/6/2012 30/6/2012 23:59:59 2 5 2012 1/5/2012 31/5/2012 23:59:59 2 6 2012 1/6/2012 30/6/2012 23:59:59