clear markdown compare help best fiddles feedback dbanow.uk a leap of faith?
clear markdown donate comments/suggestions/bugs a leap of faith? bible365 diddy dollings
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 1228817 fiddles created (16679 in the last week).

with tab as ( select 'Cleveland' as City, '2164445437/FTTD/JAMES, TYLER/139561151' as Emp_Num_ID from dual union all select 'Tokyo' as City, '1261120379/FTTD/BOYD, ADAMS/14468140' as Emp_Num_ID from dual union all select 'Marakech' as City, '4049838896/FTTD/SMITH, TULY E/13956144' as Emp_Num_ID from dual union all select 'Houston' as City, '7980151429/FTTD/NEARY, HARTMAN/14215411' as Emp_Num_ID from dual ) select City, substr(Emp_Num_ID,instr(Emp_Num_ID,'/',-1)+1) as id from tab where substr(Emp_Num_ID,instr(Emp_Num_ID,'/',-1)+1) = City
CITY ID
 hidden batch(es)


-- this cause an exception ORA-01722: invalid number -- because you compare 14215411c with 4 with tab as ( select 4 as City, '7980151429/FTTD/NEARY, HARTMAN/14215411c' as Emp_Num_ID from dual ) select City, substr(Emp_Num_ID,instr(Emp_Num_ID,'/',-1)+1) as id from tab where substr(Emp_Num_ID,instr(Emp_Num_ID,'/',-1)+1) = City
ORA-01722: invalid number
 hidden batch(es)