I have a query here which is stored in a table as
which is basically a Ms-Access query
can we write the same in Oracle using the "decode" function
select partno from table_name where
iif(True = True and 104 <= 104 , HP >= 50 * 1.15 / 1.15 and HP_Min <80 * 1.15 / 1.15,
iif(False = False and 107 > 104 and 149 <= 149, HP >=50 * 1.15 / 1.15 and
HP_Min <80 * 1.15 / 1.15 , iif(False = False and 104 <= 104,
HP >= 50/1 and HP_Min <80/1 ,
""))
explaination or the Pseudocode:
select partno from table_name where
if True=True and 104<=104 then
HP >= (50 * 1.15 / 1.15) and HP_Min < (80 * 1.15 / 1.15) ;
elseif False = False and 107 > 104 and 149 <= 149 then
HP >=50 * 1.15 / 1.15 and HP_Min <80 * 1.15 / 1.15 ;
elseif False = False and 104 <= 104 then
HP >= 50/1 and HP_Min <80/1;
else
null;
end if;
note : HP , HP_Min is the field name of the table
[sig][/sig]
which is basically a Ms-Access query
can we write the same in Oracle using the "decode" function
select partno from table_name where
iif(True = True and 104 <= 104 , HP >= 50 * 1.15 / 1.15 and HP_Min <80 * 1.15 / 1.15,
iif(False = False and 107 > 104 and 149 <= 149, HP >=50 * 1.15 / 1.15 and
HP_Min <80 * 1.15 / 1.15 , iif(False = False and 104 <= 104,
HP >= 50/1 and HP_Min <80/1 ,
""))
explaination or the Pseudocode:
select partno from table_name where
if True=True and 104<=104 then
HP >= (50 * 1.15 / 1.15) and HP_Min < (80 * 1.15 / 1.15) ;
elseif False = False and 107 > 104 and 149 <= 149 then
HP >=50 * 1.15 / 1.15 and HP_Min <80 * 1.15 / 1.15 ;
elseif False = False and 104 <= 104 then
HP >= 50/1 and HP_Min <80/1;
else
null;
end if;
note : HP , HP_Min is the field name of the table
[sig][/sig]