I have a table (TABLE1) updated by a second table (TABLE2) based on a common field (CODE). For each CODE match, there are from one to three TABLE1 fields (TYPE1,TYPE2,TYPE3) updated from a single TABLE2 field (GROUP). On the first match, the first GROUP value goes in TYPE1. On the next match (if there is a second match) the second GROUP value goes in TYPE2, etc.
TABLE1
CODE1 TYPE1 TYPE2 TYPE3
1234
2468
3456
TABLE2
CODE2 GROUP
1234 4
2468 5
3456 9
1234 2
2468 6
1234 7
Putting it another way ...
UPDATE TABLE1 SET
TABLE1.TYPE1 = TABLE2.GROUP 1st match
TABLE1.TYPE2 = TABLE2.GROUP 2nd match, if there is one
TABLE1.TYPE3 = TABLE2.GROUP 3rd match, if there is one
FROM TABLE1
INNER JOIN TABLE2
SELECT CODE2, GROUP,
ON TABLE1.CODE1 = TABLE2.CODE2
TABLE1
CODE1 TYPE1 TYPE2 TYPE3
1234
2468
3456
TABLE2
CODE2 GROUP
1234 4
2468 5
3456 9
1234 2
2468 6
1234 7
Putting it another way ...
UPDATE TABLE1 SET
TABLE1.TYPE1 = TABLE2.GROUP 1st match
TABLE1.TYPE2 = TABLE2.GROUP 2nd match, if there is one
TABLE1.TYPE3 = TABLE2.GROUP 3rd match, if there is one
FROM TABLE1
INNER JOIN TABLE2
SELECT CODE2, GROUP,
ON TABLE1.CODE1 = TABLE2.CODE2