In SqlDeveloper 24.3.1, if I try to create a view in datamodeler based on querys joint with union all, some columns are repeated.
select ID_PRJ_PLANNED_HIST,ID_EMPLOYEE,ID_PROJECT,ID_PROJECT_TASK,
ID_PERIOD,PLANNED_HOURS,HOLD_FLAG,SUPPORT_BAND,ID_SENIORITY_LEVEL
from TABLE_A1
union all
SELECT
cast(null as number) ID_PRJ_PLANNED_HIST,
a.id_employee,
a.id_project,
CAST(NULL AS NUMBER) AS id_project_task,
to_char(ADD_MONTHS(TRUNC(SYSDATE,'MM'), a.month_offset),'YYYY-MM') AS ID_PERIOD,
a.PLANNED_HOURS,
decode(c.project_status,'S','Y','N') HOLD_FLAG,
'A' SUPPORT_BAND,
b.ID_SENIORITY_LEVEL
FROM (
SELECT *
FROM TABLE_A2
UNPIVOT (
planned_hours FOR month_offset IN (
m0 as -1,
m1 AS 0,
m2 AS 1,
m3 AS 2
)
)
) a,TEABLE_B b,TABLE_C c
WHERE nvl(a.planned_hours,0)>0 and
a.id_project=c.id_project and
a.id_employee=b.id_employee and
c.project_status in ('J','S')
union all
SELECT
cast(null as number) ID_PRJ_PLANNED_HIST,
a.id_employee,
a.id_project,
a.id_project_task,
to_char(ADD_MONTHS(TRUNC(SYSDATE,'MM'), a.month_offset),'YYYY-MM') AS ID_PERIOD,
a.PLANNED_HOURS,
decode(c.task_status,'H','Y','N') HOLD_FLAG,
a.SUPPORT_BAND,
b.ID_SENIORITY_LEVEL
FROM (
SELECT *
FROM TABLE_A3
UNPIVOT (
planned_hours FOR month_offset IN (
m0 as -1,
m1 AS 0,
m2 AS 1,
m3 AS 2
)
)
) a,TABLE_B b,TABLE_D c
WHERE nvl(a.planned_hours,0)>0 and
a.id_project_task=c.id_project_task and
a.id_employee=b.id_employee and
c.task_status in ('A','H')
This query returns values like this

But the generated view show these columns:

There is some way to remove all the duplicated columns (Those ended with _1 and _2)?