select * from (select * from (select case when rownum > 2 then ' ' || decode(a.ZDMC00,'','—',a.ZDMC00) else a.zdlbmc || ' ' || decode(a.ZDMC00,'','—',a.ZDMC00) end ZDMC00, case when zdlbmc is not null and ZDMC00 is null then '—' else a.ZDM000 end ZDM000, case when zdlbmc is not null and ZDMC00 is null then '—' else decode(a.RYBQ00,'有','1','临床未确定','2','情况不明','3','无','4') end RYBQ00 from (select decode(n.zdlbmc, '出院主要诊断', '主要诊断', '出院其他诊断', '其他诊断',n.zdlbmc) zdlbmc, SF_ZS_ZDMCFWBW_DZBL(FWMC00,BWMC00,ZDMC00,ZDBZ00) ZDMC00, t.ZDM000, t.rybq00 from (select dm0000,mc0000 zdlbmc from XT_ZDLB00 where dm0000 in('3','4')) n left join VW_BQ_BRZDXX_DZBL t on n.dm0000=t.ZDLB00 and zyid00 =2212116 and ZDFS00 = '1' order by dm0000, PLXH00,ZDPLXH , ID0000) a where rownum < 10) union all select null zdmc00, null zdm000, null ryqk00 from dual connect by level < 10) where rownum < 10