当我跟随where子句的contion时,我得到ORA-00920: invalid relational operator
错误。
and (round(to_number(c.rest_time - a.TIME_STAMP) * 24 * 60 )) > 5
Full Where子句
From TableA a,TableB b
where round(to_number(a.rest_time - a.time_stamp) * 24 * 60 )) > 5
and a.time_stamp > '05-12-2014 22:00:00'
and a.rest_time < '05-14-2014 14:00:00'
and a.dev = 'CUSTOMER'
and b.xid = a.xid
and b.accno = a.accno
and b.name is not null
and b.dis is null
答案 0 :(得分:1)
你有额外的右括号。它应该是... where round(to_number(a.rest_time - a.time_stamp) * 24 * 60 ) > 5 ...
例如,
-- your case (throws invalid relational operator ):
select 1 from dual where round(to_number(sysdate- sysdate) * 24 * 60 )) > 5 ;
--corrected :
select 1 from dual where round(to_number(sysdate- sysdate) * 24 * 60 ) > 5 ;