Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

decode or case to use?

530678Nov 27 2006 — edited Nov 27 2006
Hi 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.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 25 2006
Added on Nov 27 2006
5 comments
210 views