在下面的代码(我继承的)中,我收到消息“SQL80001 - ')' 附近的语法不正确”,错误出现在从底部算起的第三行,带有 + 号。我已经看过类似问题的这个答案,但这不是这里的问题。
select
b.batch_id,
b.submitted_dt,
b.batch_nm,
b.paused_cd,
b.job_cnt,
b.start_dt,
b.finish_dt,
m.module_nm,
m.module_id,
mc.hostname
from
tbl_bat_chess b,
tbl_job_bobs j,
tbl_man_holes m,
tbl_monkey_cokes mc
where
b.finish_dt is null
and to_char(b.submitted_dt, 'DD-MON-YYYY') = to_char(sysdate, 'DD-MON-YYYY')
and (to_number(sysdate - b.submitted_dt) * 1440) > 5 -- 5 minutes
and b.batch_id = j.batch_id
and b.batch_nm like '%EXAMPLE%'
and j.module_id = m.module_id
and m.proc_group_id not in (10, 18)
and j.machine_id = mc.machine_id (+)
group by b.batch_id, b.submitted_dt, b.batch_nm, b.paused_cd, b.job_cnt, b.start_dt, …
Run Code Online (Sandbox Code Playgroud)