I want to group several rows of table A and insert a new row into table B for each bunch of grouped rows.
Next to that I want to update the rows of table A with the ID of the newly inserted row.
Inserting the lines into the table with ‘grouplines’ is like:
INSERT INTO B(...,...,...) SELECT col1, col2 FROM A GROUP BY col1,col2
This will produce a list of IDs in table B. I want to update the rows of table A with the ID of the corresponding group-row of table B.
Is there a possibilty to do this?
Some sample data:
After grouping table B looks like:
And then table A should look like: