Look at this logic, this is just an example, you see the GROUP BY there are a total of 6 fields, while the SELECT is only 4 fields, none of the SELECT are either SUM or COUNT.
Why is this working ? I believe it shouldn't, I believe the number of field of SELECT you have is the number of GROUP BY you should have with the exception to the SELECT having SUM or COUNT.
However in this case is not, we have more GROUP BY fields than we have SELECT fields.
Code:
INSERT INTO [tableA] (A, I, C, R)
SELECT tableB.A, tableB.B, tableC.D, tableB.E
FROM (tableB LEFT JOIN tableE ON tableB.A = tableE.C) LEFT JOIN tableC ON tableB.B = tableC.B
GROUP BY tableB.A, tableB.B, tableC.D, tableB.E, tableC.B, table.C