创建视图失败
Failed to create view
CREATE OR REPLACE VIEW ALL_INTERRUPTED_DATA AS
select
trigger_info_A.b1,
trigger_info_A.b2,
trigger_info_A.B3TEXT,
trigger_info_A.elem,
trigger_info_B.b1,
trigger_info_B.b2,
trigger_info_B.B3TEXT,
trigger_info_B.elem,
oms_source.source_code,
energization_info.b1,
energization_info.b2,
energization_info.b3text,
to_char(energization_info.deenergized_date,'DD-MM-YYYY Hh24:MI:SS'),
to_char(energization_info.energized_date,'DD-MM-YYYY Hh24:MI:SS'),
oms_source.connected_customer,
trigger_info_A.comments
from
energization_info,
trigger_info trigger_info_A,
trigger_info trigger_info_B,
oms_source
where
(
energization_info.trigger_number = trigger_info_A.trigger_number
)
and (
energization_info.ENERGIZED_TRIGGER_NUMBER = trigger_info_B.trigger_number
)
and (
energization_info.b1 = oms_source.B1NAME
and energization_info.b2 = oms_source.B2NAME
and energization_info.b3 = oms_source.B3NAME
) WITH READ ONLY;
trigger_info_B。
ERROR at line 3:
ORA-00957: duplicate column name
我可以在 select 子句中看到重复的名称。
示例:
trigger_info_A.b1
trigger_info_B.b1
创建视图时,select 中的每个列必须具有不同的 name/alias。
尝试找到重复的列名,并使用别名给它们不同的名称。
示例:
trigger_info_A.b1 as A_b1
trigger_info_B.b1 as B_b1
CREATE OR REPLACE VIEW ALL_INTERRUPTED_DATA AS
select
trigger_info_A.b1,
trigger_info_A.b2,
trigger_info_A.B3TEXT,
trigger_info_A.elem,
trigger_info_B.b1,
trigger_info_B.b2,
trigger_info_B.B3TEXT,
trigger_info_B.elem,
oms_source.source_code,
energization_info.b1,
energization_info.b2,
energization_info.b3text,
to_char(energization_info.deenergized_date,'DD-MM-YYYY Hh24:MI:SS'),
to_char(energization_info.energized_date,'DD-MM-YYYY Hh24:MI:SS'),
oms_source.connected_customer,
trigger_info_A.comments
from
energization_info,
trigger_info trigger_info_A,
trigger_info trigger_info_B,
oms_source
where
(
energization_info.trigger_number = trigger_info_A.trigger_number
)
and (
energization_info.ENERGIZED_TRIGGER_NUMBER = trigger_info_B.trigger_number
)
and (
energization_info.b1 = oms_source.B1NAME
and energization_info.b2 = oms_source.B2NAME
and energization_info.b3 = oms_source.B3NAME
) WITH READ ONLY;
trigger_info_B。
ERROR at line 3:
ORA-00957: duplicate column name
我可以在 select 子句中看到重复的名称。
示例:
trigger_info_A.b1
trigger_info_B.b1
创建视图时,select 中的每个列必须具有不同的 name/alias。
尝试找到重复的列名,并使用别名给它们不同的名称。
示例:
trigger_info_A.b1 as A_b1
trigger_info_B.b1 as B_b1