我有一张表格,其中一个字段有一个数字。根据这个数字,我想让SQL将记录插入到另一张表中。下面是第一张表的示例:
Event Fields Type
Swimming 3 Basic
Swimming 2 Advanced
Running 5 Basic
Running 1 Advanced
根据上表,我希望使用SQL插入以下记录:
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
我认为我需要使用WHILE循环,但不知道从哪里开始!非常感谢任何帮助。