select daytime::date from generate_series(
('2017-06-01'),--查询开始日期(可根据需求调整)
(select now()::date),--查询结束日期(可根据需求调整)
'1 day'--间隔(可根据需求调整)
) s(daytime)
select daytime,periods from (select daytime::date
from generate_series(
(select min(score_date) from tableA),--查询开始日期
(select now()::date),--查询结束日期
'1 day'--间隔
) s(daytime)) t ,tableA where
(t.daytime >((substr(time_period,0,5)||'-'||substr(time_period,5,2)||'-'||substr(time_period,7,2))::timestamp + '-1 day')::date )
and t.daytime ((substr(time_period,10,4)||'-'||substr(time_period,14,2)||'-'||substr(time_period,16,2))::timestamp + '1 day')::date