22,210
社区成员
发帖
与我相关
我的任务
分享
with timetmp
as
(
select 1 as id, cast('00:00:00' as time(0)) as timeSection
union all
select id+1 as id, cast(dateadd(mi,30,timeSection) as time(0)) as timeSection
from timetmp where id<49
)
select
A.timeSection as timeSectionFrom,
B.timeSection as timeSectionTo,
cast(A.timeSection as varchar(10))+'~'+cast(B.timeSection as varchar(10)) as timeSection
from timetmp A inner join timetmp B on A.id= B.id-1
timeSectionFrom timeSectionTo timeSection
---------------- ---------------- ---------------------
00:00:00 00:30:00 00:00:00~00:30:00
00:30:00 01:00:00 00:30:00~01:00:00
01:00:00 01:30:00 01:00:00~01:30:00
01:30:00 02:00:00 01:30:00~02:00:00
02:00:00 02:30:00 02:00:00~02:30:00
02:30:00 03:00:00 02:30:00~03:00:00
03:00:00 03:30:00 03:00:00~03:30:00
03:30:00 04:00:00 03:30:00~04:00:00
04:00:00 04:30:00 04:00:00~04:30:00
04:30:00 05:00:00 04:30:00~05:00:00
05:00:00 05:30:00 05:00:00~05:30:00
05:30:00 06:00:00 05:30:00~06:00:00
06:00:00 06:30:00 06:00:00~06:30:00
06:30:00 07:00:00 06:30:00~07:00:00
07:00:00 07:30:00 07:00:00~07:30:00
07:30:00 08:00:00 07:30:00~08:00:00
08:00:00 08:30:00 08:00:00~08:30:00
08:30:00 09:00:00 08:30:00~09:00:00
09:00:00 09:30:00 09:00:00~09:30:00
09:30:00 10:00:00 09:30:00~10:00:00
10:00:00 10:30:00 10:00:00~10:30:00
10:30:00 11:00:00 10:30:00~11:00:00
11:00:00 11:30:00 11:00:00~11:30:00
11:30:00 12:00:00 11:30:00~12:00:00
12:00:00 12:30:00 12:00:00~12:30:00
12:30:00 13:00:00 12:30:00~13:00:00
13:00:00 13:30:00 13:00:00~13:30:00
13:30:00 14:00:00 13:30:00~14:00:00
14:00:00 14:30:00 14:00:00~14:30:00
14:30:00 15:00:00 14:30:00~15:00:00
15:00:00 15:30:00 15:00:00~15:30:00
15:30:00 16:00:00 15:30:00~16:00:00
16:00:00 16:30:00 16:00:00~16:30:00
16:30:00 17:00:00 16:30:00~17:00:00
17:00:00 17:30:00 17:00:00~17:30:00
17:30:00 18:00:00 17:30:00~18:00:00
18:00:00 18:30:00 18:00:00~18:30:00
18:30:00 19:00:00 18:30:00~19:00:00
19:00:00 19:30:00 19:00:00~19:30:00
19:30:00 20:00:00 19:30:00~20:00:00
20:00:00 20:30:00 20:00:00~20:30:00
20:30:00 21:00:00 20:30:00~21:00:00
21:00:00 21:30:00 21:00:00~21:30:00
21:30:00 22:00:00 21:30:00~22:00:00
22:00:00 22:30:00 22:00:00~22:30:00
22:30:00 23:00:00 22:30:00~23:00:00
23:00:00 23:30:00 23:00:00~23:30:00
23:30:00 00:00:00 23:30:00~00:00:00
(48 行受影响)
timeSectionFrom timeSectionTo timeSection
---------------- ---------------- ---------------------
00:00:00 00:30:00 00:00:00~00:30:00
00:30:00 01:00:00 00:30:00~01:00:00
01:00:00 01:30:00 01:00:00~01:30:00
01:30:00 02:00:00 01:30:00~02:00:00
02:00:00 02:30:00 02:00:00~02:30:00
02:30:00 03:00:00 02:30:00~03:00:00
03:00:00 03:30:00 03:00:00~03:30:00
03:30:00 04:00:00 03:30:00~04:00:00
04:00:00 04:30:00 04:00:00~04:30:00
04:30:00 05:00:00 04:30:00~05:00:00
05:00:00 05:30:00 05:00:00~05:30:00
05:30:00 06:00:00 05:30:00~06:00:00
06:00:00 06:30:00 06:00:00~06:30:00
06:30:00 07:00:00 06:30:00~07:00:00
07:00:00 07:30:00 07:00:00~07:30:00
07:30:00 08:00:00 07:30:00~08:00:00
08:00:00 08:30:00 08:00:00~08:30:00
08:30:00 09:00:00 08:30:00~09:00:00
09:00:00 09:30:00 09:00:00~09:30:00
09:30:00 10:00:00 09:30:00~10:00:00
10:00:00 10:30:00 10:00:00~10:30:00
10:30:00 11:00:00 10:30:00~11:00:00
11:00:00 11:30:00 11:00:00~11:30:00
11:30:00 12:00:00 11:30:00~12:00:00
12:00:00 12:30:00 12:00:00~12:30:00
12:30:00 13:00:00 12:30:00~13:00:00
13:00:00 13:30:00 13:00:00~13:30:00
13:30:00 14:00:00 13:30:00~14:00:00
14:00:00 14:30:00 14:00:00~14:30:00
14:30:00 15:00:00 14:30:00~15:00:00
15:00:00 15:30:00 15:00:00~15:30:00
15:30:00 16:00:00 15:30:00~16:00:00
16:00:00 16:30:00 16:00:00~16:30:00
16:30:00 17:00:00 16:30:00~17:00:00
17:00:00 17:30:00 17:00:00~17:30:00
17:30:00 18:00:00 17:30:00~18:00:00
18:00:00 18:30:00 18:00:00~18:30:00
18:30:00 19:00:00 18:30:00~19:00:00
19:00:00 19:30:00 19:00:00~19:30:00
19:30:00 20:00:00 19:30:00~20:00:00
20:00:00 20:30:00 20:00:00~20:30:00
20:30:00 21:00:00 20:30:00~21:00:00
21:00:00 21:30:00 21:00:00~21:30:00
21:30:00 22:00:00 21:30:00~22:00:00
22:00:00 22:30:00 22:00:00~22:30:00
22:30:00 23:00:00 22:30:00~23:00:00
23:00:00 23:30:00 23:00:00~23:30:00
23:30:00 00:00:00 23:30:00~00:00:00
(48 行受影响)