I have a list of alphanumeric strings that includes two special characters +
and -
. The input, as shown below, represents part numbers for our company’s products. I would like to extract the individual components as an output. There are about 45,000 products, and the data below is a sample of the part numbers. How can I parse this string to distinguish between +
and -
and provide the correct output?
I am unsure how to distinguish between range indicated by -
and addition indicated by +
.
2
Answers
Create procedure:
and call it:
Gisted it: MySQL procedure to convert formula to list of numbers
See example.
Disassemble a string, generate series and reassemble it using two recursive subqueries and grouping back.
Output
Fiddle