oracle10g - How to fetch a part of string upto a chracter? -


i want fetch names of employees table upto character ':' couldn't substr , ltrim not working expected. below given given examples:

     abineri:rebecca c     carrington:james m     

but want them in way given below:

     rebecca c abineri     james m carrington     

i used query below in toad oracle:

<pre> <b>select name employees</b> </pre> 

please try below query:

select substr(name,(instr(name,':')+1)) || ' ' || substr(name,1,(instr(name,':'))-1) employees; 

hope above query resolve issue.


Comments