I am creating this view and I wanted to know if there is a way to create a special if/then statement within the select statement. Everything I need is in the same table. I need to select another field in the same table if one table is equal to home.
EX. IF transactions=HOME then department else transactions.
Ex.
the statement I came up with is
create view test select x, x, (transactions='HOME'(select department from deptname)) as transactions
from table;
Is there anyway to do this. The goal is to populate the transactions field with another value from another field only if this condition is true.
Any help on this one would be much appreciated.
Ed
EX. IF transactions=HOME then department else transactions.
Ex.
the statement I came up with is
create view test select x, x, (transactions='HOME'(select department from deptname)) as transactions
from table;
Is there anyway to do this. The goal is to populate the transactions field with another value from another field only if this condition is true.
Any help on this one would be much appreciated.
Ed