Working to write a query that displays a new Contact name by parsing the Location_Name and writing the Contact First Name using a substring of the Location_Name.
For instance. where the Location_Name is Walgreens #10630 would like for the Contact First name to be Location #10630
Found some info on PL/SQL SUBSTR
select SUBSTR('Walgreens #02843', 11, 8) from dual
Which is the desired result.
Now the string 'Location' should be concatenated to Location_Name substring and displayed as New_FName.
This is what has been drafted so far but after some tweeking and refactor can't get it to work
First_Name as Old_FName,
Last_Name as Old_LName,
LOCATION_NAME, 'Location' + SUBSTR(Select LOCATION_NAME, 11, 8 from dual) as New_Fname
from CCM_Contact CON
join CCM_LOCATION LOC on LOC.LOCATION_ID = OWNER_ID
where employer_id = 214782
Also included a GIF of the query output w/o the substr statement.
Allen in Dallas