I have a table which has a number in a field. Based on that number I want SQL to INSERT records into another table. Below is an example of the first table:
Event Fields Type
Swimming 3 Basic
Swimming 2 Advanced
Running 5 Basic
Running 1 Advanced
So based on the table above I would like SQL to INSERT the records below:
Event GradeType Grade
Swimming Basic1 NULL
Swimming Basic2 NULL
Swimming Basic3 NULL
Swimming Advanced1 NULL
Swimming Advanced2 NULL
Running Basic1 NULL
Running Basic2 NULL
Running Basic3 NULL
Running Basic4 NULL
Running Basic5 NULL
Running Advanced1 NULL
I think I need to use WHILE to loop through but haven't a clue where to start! All help appreciated.