Link to home
Start Free TrialLog in
Avatar of musickmann
musickmann

asked on

Create multiple records in MySQL table based on value of one field.

I am looking to create multiple records based on a single value in a field in MySQL.

I have some data that looks like this in a table in MySQL

item_id | grade
12345 | 01
12346 | 05
12347 | 09-12

I need to transform it into something that looks like this:
12345 | 01
12346 | 05
12347 | 09
12347 | 10
12347 | 11
12347 | 12

Where 09-12 is can be a range of values
09-10
11-12
06-08
etc.
SOLUTION
Avatar of Ares Kurklu
Ares Kurklu
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of theGhost_k8
theGhost_k8
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of musickmann
musickmann

ASKER

Thanks all, I'm still working on implanting these suggestions.
Author is requested to choose the best solution. Otherwise the points will be equally split between the two of the commenters offering solution.