I have a query here which is stored in a table as
which is basically a Ms-Access query.
select partno from table_name where
iif(variable_1='mercury',hiredate='1-jan-99' or matl_name='steel',matl_name='iron');
Explaination:
select partno from table_name where
if variable1='mercury' then
hiredate='1-jan-99' or matl_name='steel'
else
matl_name='iron'
end if;
note: the value of variable1 I'll be substituting at runtime and matl_name and hiredate are fields of the table.
can we write a similar query in Oracle using decode function which should appear in the "WHERE" clause.
thanx in advance
Naresh
[sig][/sig]
which is basically a Ms-Access query.
select partno from table_name where
iif(variable_1='mercury',hiredate='1-jan-99' or matl_name='steel',matl_name='iron');
Explaination:
select partno from table_name where
if variable1='mercury' then
hiredate='1-jan-99' or matl_name='steel'
else
matl_name='iron'
end if;
note: the value of variable1 I'll be substituting at runtime and matl_name and hiredate are fields of the table.
can we write a similar query in Oracle using decode function which should appear in the "WHERE" clause.
thanx in advance
Naresh
[sig][/sig]