I need to turn something like "Doe/John M" into "John M Doe"
In other words, I have to switch the first and last names around and omit the slash.
I've having some trouble with it. I know I have to use SUBSTR and INSTR in conjunction, but can't get it to work the way I want it.
So far I have:
which returns
I don't want either of those slashes.
Is there another way to get all the characters before the slash without using a number (in this case 9)? The asterisk wildcard didn't work...
I feel like this should be simple, but am stumped none-the-less. Can anyone help me out?
EDIT: nvm, it's working:
In other words, I have to switch the first and last names around and omit the slash.
I've having some trouble with it. I know I have to use SUBSTR and INSTR in conjunction, but can't get it to work the way I want it.
So far I have:
Code:
select substr(name,instr(name,'/'),9)||substr(name, 1, instr(name,'/'))
from members
where idno = '00001'
Code:
/John M Doe/
Is there another way to get all the characters before the slash without using a number (in this case 9)? The asterisk wildcard didn't work...
I feel like this should be simple, but am stumped none-the-less. Can anyone help me out?
EDIT: nvm, it's working:
Code:
select substr(name,instr(name,'/')+1)||substr(name, 1, instr(name,'/')-1)
from members
where idno = '00001'