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!

Display any phone number

S567Nov 29 2018 — edited Nov 29 2018
ID Home phonecell phone
123440120579528495795805
345792794704
245 7079480489

Hello folk's,

I have a table with 3 fields customer id , home phone,cell_phone.

My requirement is using CASE statement i need to get the phone number of customer_id based on below.

if both exists then prefer home phone

if home phone does not exists and cell phone exsist then give cell number

if cell phone does not exists and home phone exists then give home phone,

Criteria is client needs any of phone number irrespective of cell phone or home phone

ID Home phonecell phone
123440120579528495795805
345792794704
245 7079480489

Thanks,

Shv

This post has been answered by Hans Steijntjes on Nov 29 2018
Jump to Answer
Comments
Post Details
Added on Nov 29 2018
4 comments
280 views