I have a varchar which can have these values:
"Office: (415) 438-4437"
"Office: (602) 740-6409 Fred Cohen"
"Mobile: (707) 888-572"
"Phone: (707) 472-0982"
I need to separate these values as phone_type and phone columns.
Should look like these
phone type | phone |
---|---|
Office | (415) 438-4437 |
Office | (602) 740-6409 |
Mobile | (707) 888-572 |
Phone | (707) 472-0982 |
Here my code
select phone from core.person;
I can have more data after the phone number, but Just need to pick the first word of the string which is the phone_type and the phone which is (###) ###-####
, how to do that?