日期:2014-05-16 浏览次数:21034 次
create materialized view MV_ODS_TESTOLD refresh force on demand next sysdate+1/4 as
select a.serial_number,
o.order_item,
wmsys.wm_concat(a.ODS_DOUBLET) as ODS_DOUBLE,
wmsys.wm_concat(a.ODS_HORNT) as ODS_HORN,
wmsys.wm_concat(a.ODS_FROCET) as ODS_FROCE,
wmsys.wm_concat(a.ODS_WEIGHTT) as ODS_WEIGHT,
wmsys.wm_concat(a.ODS_DETECTIONT) as ODS_DETECTION,
wmsys.wm_concat(a.ODS_RESTIANCET) as ODS_RESTIANCE,
wmsys.wm_concat(a.ODS_SB_RESTIANCET) as ODS_SB_RESTIANCE,
wmsys.wm_concat(a.ODS_SINGLET) as ODS_SINGLE,
wmsys.wm_concat(a.ODS_SW_TESTT) as ODS_SW_TEST,
o.planned_line,
o.part_number,
a.unit_key
from (
select u.unit_key,u.serial_number,u.order_item_key,
d.op_name||'$'||d.dscomment||'$'||to_char(d.creation_time,'yyyy-mm-dd hh24:mi:ss')||'+'||d.angle||'+'||d.torque||'+' as ODS_DOUBLET,
h.op_name||'$'||h.dscomment||'$'||to_char(h.creation_time,'yyyy-mm-dd hh24:mi:ss')||'+'||h.anxiangli||'+' as ODS_HORNT,
f.op_name||'$'||f.dscomment||'$'||to_char(f.creation_time,'yyyy-mm-dd hh24:mi:ss')||'+'||f.froce_test||'+' as ODS_FROCET,
t.op_name||'$'||t.dscomment||'$'||to_char(t.creation_time,'yyyy-mm-dd hh24:mi:ss')||'+'||t.inflatorweight||'+' as ODS_WEIGHTT,
e.op_name||'$'||e.dscomment||'$'||to_char(e.creation_time,'yyyy-mm-dd hh24:mi:ss')||'+'||e.influential||'+' as ODS_DETECTIONT,
r.op_name||'$'||r.dscomment||'$'||to_char(r.creation_time,'yyyy-mm-dd hh24:mi:ss')||'+'||r.jueyuan||'+'||r.neizu||'+' as ODS_RESTIANCET,
s.op_name||'$'||s.dscomment||'$'||to_char(s.creation_time,'yyyy-mm-dd hh24:mi:ss')||'+'||s.sb_resistance||'+' as ODS_SB_RESTIANCET,
i.op_name||'$'||i.dscomment||'$'||to_char(i.creation_time,'yyyy-mm-dd hh24:mi:ss')||'+'||i.angle||'+'||i.torque||'+' as ODS_SINGLET,
w.op_name||'$'||w.dscomment||'$'||to_char(w.creation_time,'yyyy-mm-dd hh24:mi:ss')||'+'||w.swtest||'+' as ODS_SW_TESTT
from unit u
left join dc_double_torque d on u.unit_key=d.object_key
left join dc_horn h on u.unit_key=h.object_key
left join dc_froce_test f on u.unit_key=h.object_key
left join dc_inflatorweight t on u.unit_key=t.object_key
left join dc_influentialdetection e on u.unit_key=e.object_key
left join