--构造测试数据
with table_name as(
select '张三' name,to_date('2014-03-01','yyyy-mm-dd') dt from dual
union all
select '张三' name,to_date('2012-04-01','yyyy-mm-dd') dt from dual
union all
select '张三' name,to_date('2012-08-01','yyyy-mm-dd') dt from dual
union all
select '李四' name,to_date('2012-03-01','yyyy-mm-dd') dt from dual
union all
select '李四' name,to_date('2012-05-01','yyyy-mm-dd') dt from dual
union all
select '李四' name,to_date('2012-07-01','yyyy-mm-dd') dt from dual
)--查询语句(这里我根据姓名和年份补充所有月份)
select t.name, to_date(t.yr || '-' || t.rn, 'yyyy-mm') dt
  from (select tf.name, tf.yr, tr.rn
          from (select distinct name, to_char(dt, 'yyyy') yr from table_name) tf
          left join (select rownum rn from dual connect by rownum <= 12) tr
            on 1 = 1) t
 where not exists (select 1
          from table_name s
         where s.name = t.name
           and to_char(s.dt, 'yyyy') = t.yr
           and to_char(s.dt, 'mm') = t.rn)
 order by t.name, to_date(t.yr || '-' || t.rn, 'yyyy-mm')