Lets say you wanted to create a view that would select all the values between the first two astrices in a column you could say:
create view junk1 as
select
substr(eo_num_bcd,instr(eo_num_bcd,'*',2,1)+1,((instr(eo_num_bcd,'*',1,2) - instr(eo_num_bcd,'*',1,1)))-1)
from eo;
Not that you would want to do this, eo_num_bcd is never updated, it is a simple example. Lets say you wanted to capitalize the second word in a column you could change the * to a space in the example below.
update the mytable set mycolumn = initcap(substr(mycolumn,instr(mycolumn,' ',2,1)+1,((instr(mycolumn,' ',1,2) - instr(mycolumn,' ',1,1)))-1));
What abount making the first letter after the first / capitalized?
update scientific_name set scientific_name = initcap(substr(scientific_name,instr(scientific_name,'/')+1,1));
QUERY: Select values between two characters Print
Modified on: Mon, 9 Apr, 2018 at 1:50 PM
Did you find it helpful? Yes No
Send feedbackSorry we couldn't be helpful. Help us improve this article with your feedback.