出于月费报告的目的,需要显示如下所述的输出。仅当当月支付了费用时,数据才会输入到表中,否则该月将不会出现在表中。
在执行查询时
select reg_id, dop,to_char(dop, 'FMMonth,YYYY') Month, status
from fees_status
where dop between ('1-Jul-2012') and ('1-Dec-2012')
输出是
REG_ID DOP MONTH STATUS
AE-8 7/1/2012 July,2012 PAID
AE-8 9/1/2012 September,2012 PAID
AE-8 11/1/2012 November,2012 PAID
AE-8 12/1/2012 December,2012 PAID
出于报告目的,需要输出为
REG_ID DOP MONTH STATUS
AE-8 7/1/2012 July,2012 PAID
AE-8 8/1/2012 August,2012 NOTPAID
AE-8 9/1/2012 September,2012 PAID
AE-8 10/1/2012 October,2012 NOTPAID
AE-8 11/1/2012 November,2012 PAID
AE-8 12/1/2012 December,2012 PAID
有人可以帮助显示上面提到的输出吗?