user206168
user206168

Reputation: 1025

ORA-00920: invalid relational operator in where clause

I get ORA-00920: invalid relational operator Error when I following contion to my where clause.

and (round(to_number(c.rest_time - a.TIME_STAMP) * 24 * 60 )) >  5

Full Where clause

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 

Upvotes: 2

Views: 11530

Answers (1)

a1ex07
a1ex07

Reputation: 37354

You have extra right parenthesis . It should be ... where round(to_number(a.rest_time - a.time_stamp) * 24 * 60 ) > 5 ...

For instance,

-- 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 ;

Upvotes: 1

Related Questions