decode or case to use?
530678Nov 27 2006 — edited Nov 27 2006Hi I need to pick up the PER phone # if person has one in the table otherwise, I need to pick up the BUS phone.
A person may have PER phone # or may not.
sample data:
person type phone
123 -- PER --456-758-1234
123 -- BUS -- 785-248-4568
345 -- PER -- 789-456-7899
456 -- BUS -- 456-154=7856
so, the output should:
person type phone
123 -- PER-- 456-758-1234
345 -- PER 789-456-7899
456 -- BUS -- 456-154=7856
Thanks.