You are on page 1of 2

select

c.cable_num,
c.cable_desc,
uc.cbl_udf_c01,
uc.cbl_udf_c02,
uc.cbl_udf_c101,
cg1.cable_gland_name,
cg2.cable_gland_name,
(
select
max(p.panel_name)
from
panel p,
wire_terminal wt
where
p.panel_id = wt.panel_id and
wt.cable_id = c.cable_id and
wt.cable_side = 1
) as panel_name_from,
(
select
max(p.panel_name)
from
panel p,
wire_terminal wt
where
p.panel_id = wt.panel_id and
wt.cable_id = c.cable_id and
wt.cable_side = 2
) as panel_name_to,
(
select
max(rs.routing_section_desc)
from
routing_section rs,
cable_routing_section crs
where
c.cable_id = crs.cable_id and
crs.routing_section_id = rs.routing_section_id
) as routing_section_desc,
(
select
max(rs.routing_section_length)
from
routing_section rs,
cable_routing_section crs,
unit_of_measure uom2
where
rs.routing_section_length_uom_id = uom2.uom_id and
c.cable_id = crs.cable_id and
crs.routing_section_id = rs.routing_section_id
) as routing_section_length,
(
select
max(srw.std_routing_width)
from
standard_routing_width srw,
routing_position_width rpw,
routing_section_position rsp,
cable_routing_section crs
where
srw.std_routing_width_id = rpw.std_routing_width_id and
rpw.std_routing_pos_id = rsp.std_routing_pos_id and
rsp.routing_section_id = crs.routing_section_id and
crs.cable_id = c.cable_id
) as std_routing_width,
uc.cbl_udf_c03,
cmm.cable_mod_desc,
cmm.insulation,
c.cable_length,
uom.uom_code,
pau.unit_num,
pau.unit_udf_c01,
p.location
from
cable c,
udf_cable uc,
plant_area_unit pau,
plant p,
cable_gland cg1,
cable_gland cg2,
unit_of_measure uom,
cable_mfr_mod cmm
where
c.cable_gland_side1_id = cg1.cable_gland_id and
c.cable_gland_side2_id = cg2.cable_gland_id and
c.cable_id = uc.cable_id and
c.length_uom_id = uom.uom_id and
c.cable_mod_id = cmm.cable_mod_id and
c.plant_id = p.plant_id and
c.unit_id = pau.unit_id and
pau.unit_id > 0

You might also like