how to use decode on the value part ?
551174Feb 14 2008 — edited Feb 14 2008i have a query
select
col1, col2, col3
from
tab1, tab2
where
cond1= 'parameter1'
I need to modify this query to use a decode function instead of this parameter1.
something like
select
col1, col2, col3
from
tab1, tab2
where
cond1= decode(parameter1, 'x','val1','val2')
How can i use such a decode function on the value part ?
IF i try this, it gives me no data found error....
The following is also not working..IS there a way to do such cases ?
select
col1, col2, col3
from
tab1, tab2
where
cond1= ( select decode(parameter1, 'x','val1','val2') from dual )