  CREATE OR REPLACE FORCE VIEW "AB03B"."AB03B62V00" ("ID011", "DESCES011", "DESCEU011", "ID062", "ID011TPDOC", "ID015DOC", "ID008TIPOPLAN") AS 
  select ID011, DESCES011, DESCEU011,
tt62.ID_062 ID062,tt62.ID_011_TP_DOC ID011TPDOC, tt62.ID_015_DOC ID015DOC, ID008TIPOPLAN
from
(SELECT t1.id_011 ID011, T1.DESC_ES_011 DESCES011, T1.DESC_EU_011 DESCEU011, T1.ID_008_TIPO_PLAN ID008TIPOPLAN
FROM AB03B11T00 T1
INNER JOIN AB03B62T00 T62 ON T62.ID_011_TP_DOC = T1.ID_011
WHERE T1.ID_001_FASE=2 AND T1.ID_002_TRAMITE=3 AND T1.ID_007_TP_DOC_DOKUSI NOT IN (1,10)
UNION
SELECT t1.id_011 ID011, T1.DESC_ES_011 DESCES011, T1.DESC_EU_011 DESCEU011, T1.ID_008_TIPO_PLAN ID008TIPOPLAN
FROM AB03B11T00 T1
WHERE T1.ID_001_FASE=2 AND T1.ID_002_TRAMITE=3 AND T1.ID_007_TP_DOC_DOKUSI NOT IN (1,10)
order by 1) tab
left JOIN AB03B62T00 Tt62 ON Tt62.ID_011_TP_DOC = Tab.ID011;
