How do you change this statement?
Between before and after values in the field name, such as 40019. The test; Height: 5012 m is: 400019-5012 - m
CodePudding user response:
The SET @ TMP:='40019. The test; Height: 5012 meters';
SELECT CONCAT (SUBSTR (@ TMP, 1, INSTR (@ TMP, '. ') - 1), '-', SUBSTR (@ TMP, INSTR (@ TMP, ':') + 1))
CodePudding user response:
Take the field in the table name value in the treatmentCodePudding user response:
Select concat (substring_index (name, '. ', 1), "-", substring_index (name, ':', 1)) as name1 from tb1CodePudding user response:
Positive solution
The SET @ TMP:='40019. The test; Height: 5012 meters';
SELECT CONCAT (SUBSTR (@ TMP, 1, INSTR (@ TMP, '. ') - 1), '-', SUBSTR (@ TMP, INSTR (@ TMP, ':') + 1))