如果sql中缺少日期序列,则插入日期间隔

时间:2014-09-11 07:21:22

标签: mysql sql

我在下面查询时段结束日期差距14天,它返回正确的输出,但我想在查询中插入错过的期间结束日期

Select *
From CURRENT_TIME 
left Outer Join
EMPLOYEE
on CURRENT_TIME.Employee = EMPLOYEE.Employee 
Where CURRENT_TIME.Employee = 'abc' and CURRENT_TIME.Period_End_Date > '2014-06-01'

它给我输出像

EMPLOYEE  Period_End_Date Amount
---------------------------------
abc        2014-06-07     100
abc        2014-06-21     200
abc        2014-07-05     100
abc        2014-08-30     100

但我喜欢下面的输出

EMPLOYEE  Period_End_Date Amount
---------------------------------
abc        2014-06-07     100
abc        2014-06-21     200
abc        2014-07-05     100
abc        2014-07-19     null
abc        2014-08-02     null
abc        2014-08-16     null
abc        2014-08-30     100

帮助

0 个答案:

没有答案