更改原因查询:
select lh.line_id,
lh.reason_code,
lh.reason_id,
r.reason_id,
r.reason_code,
r.reason_type,
lu.lookup_type,
lu.lookup_code
from oe_order_lines_all l,
oe_order_headers_all h,
oe_order_lines_history lh,
oe_reasons r,
oe_lookups lu
where lh.header_id = h.header_id
and l.header_id = h.header_id
and l.line_id = lh.line_id
AND r.reason_id = lh.reason_id
and r.reason_code = lu.lookup_code
and lu.lookup_type = 'CANCEL_CODE'
and lh.line_id = 3079
lh.reason_code,
lh.reason_id,
r.reason_id,
r.reason_code,
r.reason_type,
lu.lookup_type,
lu.lookup_code
from oe_order_lines_all l,
oe_order_headers_all h,
oe_order_lines_history lh,
oe_reasons r,
oe_lookups lu
where lh.header_id = h.header_id
and l.header_id = h.header_id
and l.line_id = lh.line_id
AND r.reason_id = lh.reason_id
and r.reason_code = lu.lookup_code
and lu.lookup_type = 'CANCEL_CODE'
and lh.line_id = 3079