> 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),并且想要获取(cycleNO,month,year,start date,close date)条件为state = 0和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