sql intercepts the characters between the first occurrence and the last occurrence of a character intercepts the characters at the specified two positions

 

 

 

select substr('0!027!033!P009JM!02721!0272106',

                     instr ('0! 027! 033! P009JM! 02721! 0272106', '!', 2,3) +1,

                      instr ('0! 027! 033! P009JM! 02721! 0272106', '!', 2,4) -1-instr ('0! 027! 033! P009JM! 02721! 0272106', '!', 2,3 )

)

from dual; 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327082643&siteId=291194637