Replacing and removing leading characters


I have this query
Select Distinct EMPLOYEE_ID from TABLE
and this returns bunch of EMPLOYEE ID’s with leading zero’s if the person’s ID starts with 000 then it should be an ‘e’ and if it’s 00 then it should be a ‘u’
so for example if I have
0041258 this should show in the result as u41258 and if I have
00041258 then this should show as e41258
Is there a way to trim and replace in more efficient way that using substr and Case statement? and if no can you please show me how to use the substr and the Case statement in this case

Link: Replacing and removing leading characters
Source: Stack Sql


About Author

Leave A Reply