Such as 16 _4253116201_3600 * 1 * 4 after the string may take six of seven after eight this SQL how to write
CodePudding user response:
String before half if solid, then the goal of intercepting the starting position of the string is certain, not sure the length of the intercept, but the length can be calculated according to the length and the location of the intercept,SUBSTR intercept substring
Grammar: SUBSTR (string, a [b])
Function: return to the starting from a position of a substring of string b characters long. The position of the first character is a 1. If a is 0, then it is considered to start with the first character. If it is a positive number, return character calculated from left to right. If b is negative, then the return of characters from a string calculated from right to left at the end of the beginning. If b doesn't exist, then it will be the default Settings for the entire string. If less than 1 b, then will return NULL. If a or b use floating point Numbers, then the value will be for first before processing an integer.
Use location: procedural statements and SQL statements,
CodePudding user response:
Calculation can be upstairs, you can also use regularWith TMP as
(select '16 _4253116201_3600 * 1 * 4' as p_str from dual)
The select regexp_substr (TMP) p_str,
'[^ _] +'
1,
Regexp_count (TMP) p_str, '[^ _] +))
The from TMP.
CodePudding user response: