Trim string up to certain character in sql (oracle) -
looking here if can offer some. working oracle database , trim string until character '/'. these fields paths of url , different sizes need make sure it's getting last '/' in url , removing until point. additionally, there session id associated of these urls located @ end of string , has semi-colon before starts, want remove contains semi-colon semi_colon , on. want remove content beginning of url , end of url if applicable. examples of these url's (string) follows:
current urls /ingaccess/jsp/mslogon.jsp /ingaccess/help/helpie_term_cash_surrender_value.html /eportal/logout.do;jsessionid=xr8co1kyebrve47xsjwmzw--.p704 /eportal/logout.do;jsessionid=gdh_e_e1m1hna0z9ednklg--.p705 /ingaccess/help/helpie_term_northern_unit_value.html /ingaccess/help/helpie_scheduled_rebalance.html /eportal/home.action;jsessionid=9vhfbkhunkvtcm5g1dtgsa--.p704 /ingaccess/help/helpie_catch_up_50.html /ingaccess/piechartmaker /ingaccess/help/helpie_term_fund_balance.html desired urls mslogon.jsp helpie_term_cash_surrender_value.html logout.do logout.do helpie_term_northern_unit_value.html helpie_scheduled_rebalance.html home.action helpie_catch_up_50.html piechartmaker helpie_term_fund_balance.html
anyone know of easy fix here? i've tried working substr , replace bit can't seem them work.
thanks bunch in advance,
ryan
try this
select case when instr (surname,';')>0 substr(surname,1 ,instr(surname,';',1,1)-1) else surname end (select substr(column,instr(column,'/',-1)+1) surname tablename)
tested on apex
Comments
Post a Comment