026, MySQL take the left of the string, the right to take the string, the string take the middle, taking the start position of text

# Take the text left
 the SELECT  the LEFT ( ' Field climbing 520 ' , 1 ); # field
 the SELECT  the LEFT ( ' Field climbing 520 ' , 2 ); # field climb
 the SELECT  the LEFT ( ' Field climbing 520 ' , 3 ); # field climbing 5 

# text to the right to take 
the SELECT  RIGHT ( ' field Pan 52 is ' , . 1 ); # 2 
the SELECT  RIGHT ( ' field Pan 52 is ' , 2 ); # 52 is 
the SELECT RIGHT ( ' Field climbing 52 ' , 3 ); # Pan 52 

intermediate # fetch text 
the SELECT  the SUBSTRING ( ' Field climbing 520 ' , ' 1 ' , ' 2 ' ); # field climb
 the SELECT  the SUBSTRING ( ' Field climbing 520 ' , ' 2 ' , ' 2 ' ); # 5 climb 

start position acquired from the string s # s1 in 
the SELECT the LOCATE ( ' 52 is ' , ' field climbing 520 ' );#3
SELECT POSITION('52' IN '田攀520');                #3

 

Beginning of the heart do not forget, if you think this article valuable, authors agree to pay, micro-channel two-dimensional code can be any amount of a reward to the author (Micro Signal: 382 477 247) Oh, thank you.

Guess you like

Origin www.cnblogs.com/tianpan2019/p/11850806.html