17,086
社区成员
发帖
与我相关
我的任务
分享
select * from (
select
case
when a.PROCESS_ID in ('101291','101508')then a.customer_sn
when a.PROCESS_ID in ('101509','101510') then a.serial_number
end as SN,
case
when a.PROCESS_ID in ('101291','101508') then b.fw_version_b
when a.PROCESS_ID = '101509' then b.fw_version_l
when a.PROCESS_ID = '101510' then b.fw_version_r
end as FW
from aa partition(P_C_202003) a
left join bb partition(P_A_202003) b on
(case
when a.PROCESS_ID in ('101291','101508')then a.customer_sn
when a.PROCESS_ID in ('101509','101510') then a.serial_number
end ) = b.sn
and (case
when a.PROCESS_ID in ('101291','101508') then b.fw_version_b
when a.PROCESS_ID = '101509' then b.fw_version_l
when a.PROCESS_ID = '101510' then b.fw_version_r
end ) is not null
where a.current_status=0
and a.process_id in ('101291','101509','101510','101508')
and a.out_process_time between to_date('2020-03-23 11:00:00','yyyy-mm-dd hh24:mi:ss')
and to_date('2020-03-23 19:00:00','yyyy-mm-dd hh24:mi:ss')
)
where FW is null;