hi all,
I want to use Relational Operator in Where clause but as Parameter, how I can do it? below is the working i tried to achieve but it is showing error
ORA-00920: invalid relational operator
can i use CASE here to check like this: CASE WHEN :bal = 'G' THEN '>' WHEN :bal = 'E' THEN '=' WHEN :bal = 'L' THEN '<' END
select cust_id, amt from (
with mytab as (Select 1 cust_id, 100 amt from dual
union all
select 1, 50 from dual
union all
select 2, 10 from dual
union all
select 2, -10 from dual
union all
select 3, 50 from dual
union all
select 3, -60 from dual
)
select cust_id, sum(amt) amt
from mytab
group by cust_id
)
where amt :bal 0
please help.
regards