where0_sql := 'where a.serial_id =' || serialid ||
'and a.status=''3'' ';
where_sql:= where0_sql ||
' AND ((to_number(substr(trim(a.A_NUM),instr(trim(a.A_NUM),'-',1)+1)) -
to_number(substr(trim(a.A_NUM),1,instr(trim(a.A_NUM),'-',1)-1)))!=
(to_number(substr(trim(a.Z_NUM),instr(trim(a.Z_NUM),'-',1)+1)) -
to_number(substr(trim(a.Z_NUM),1,instr(trim(a.Z_NUM),'-',1)-1))))';
a.A_NUM 和 a.Z_NUM 都是varchar2类型;已经限制这2个字段必须是类似'1-10','11-20'这种规范;
就是希望实现验证 (10-1)是否等于 (20-11)
为什么会报错呢,请大家看看是哪里的问题,谢谢
|