Simple and practical, not much nonsense said:
[SQL] view plain copy Select Substr (' A, ', 2,1) from dual;
substr (' character to intercept ', length of character, character length-1)
Extended:
[SQL] view plain copy Select substr (T.province,length (t.province), Length (t.province)-1) from T_d_sysnotice t Where t.province is not null
=============================================================================================
"Add 2014-06-30 17:12:48" to intercept according to a particular character, such as: "/"
Data in the database:/res/upload/interface/apptutorials/country/fb3749d1-0621-423d-95e5-095bfce417e5.png
Target Result: fb3749d1-0621-423d-95e5-095bfce417e5.png
That is, from the last "/" intercept, take the name of the picture, the original path + name
Execute the SQL statement to get the original data result:
[SQL] view plain copy select P.countryname,p.countrypic from T_d_country p where p.s_isdeleted = 0 ORDER by NLS Sort (Trim (p.countryname), ' Nls_sort=schinese_pinyin_m ') ASC
Target SQL statement:
[SQL] view plain copy Select P.countryname, substr (p.countrypic, Length (p.countrypic)-ins TR (p.countrypic, '/', -1,1) +4, Length (p.countrypic)) from T_d_country p here p.s_isdeleted = 0;
Key SQL statement: substr (P.countrypic,
Length (P.countrypic)-InStr (P.countrypic, '/', -1,1) +4,
Length (P.countrypic))
SUBSTR ("String to intercept", "Start position","length of interception")
Select substr (' Abcdae ', 1,1) from dual;
Result: A
Select substr (' Abcdae ', -1,1) from dual;
Result: E
SUBSTR Extensions in Oracle: http://www.cnblogs.com/suding1188/archive/2012/05/25/2517901.html
InStr ("string", "character", "Start position", "position taken")
Select InStr (' Abcdae ', ' a ', 1,1) from dual;
Results: 1
Select InStr (' Abcdae ', ' a ', 1,2) from dual;
Results: 5
Select InStr (' Abcdae ', ' a ', -1,1) from dual;
Results: 5
Oracle InStr Extension: http://blog.163.com/liu_yang1234/blog/static/2447431020112290109559/
"Start position" is a positive number: Follow the take, negative, reverse.