我试图找到“id_case”(这里id_case是数字)为空或小于1的值,但得到“ORA-01722:invalid number“,查询如下:
SELECT v.id, v.id_case_p, v.id_case FROM (
SELECT p.id, to_number(replace(p.description,'xyy_','')) as id_case_p, c.id as id_case
FROM t_processes p left join t_cases c on to_number(replace(p.description,'xyz_','')) = c.id
where p.active ='Y' and p.id_process_step < 10
)v
WHERE v.id_case < 1
;
我也试过下面的方法,但还是出现了同样的错误。
SELECT v.id, v.id_case_p, v.id_case FROM (
SELECT p.id, to_number(replace(p.description,'xyy_','')) as id_case_p, c.id as id_case
FROM t_processes p left join t_cases c on to_number(replace(p.description,'xyz_','')) = c.id
where p.active ='Y' and p.id_process_step < 10
)v
WHERE v.id_case is null
;
任何线索都将不胜感激。
1条答案
按热度按时间wz1wpwve1#
请运行:
看看你能得到什么。
还运行:
看看这会带来什么。